Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
vim /var/lib/postgresql/daselement-munich/postgres.conf

# uncomment and change the line:
listen_addresses = '*'

>>> remove? # and change the port to 5433 to avoid conflicts with production any default instances that are running on port 5432
>>> remove? #portport = 5433

# start the Postgres server
pg_ctl -D /var/lib/postgresql/daselement-data start

create a user account

Code Block
# create user that is allowed to create new databases and read/write information
CREATE ROLE dbuser LOGIN password 'password';
ALTER USER dbuser CREATEDB;

create a replication user

Code Block
# create replication user
# postgres is the default postgres database
psql --port 54325433 postgres

[local]:54325433 postgres=# create user repuser replication;

...

command

description

\l

list all databases

\dt

\du

list all users

\dRp

lists available publications

\dRs

lists available subscriptions

ALTER USER user_name WITH PASSWORD 'new_password';

change user password

Can not start Postgres Database

Code Block
FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5434.lock": Permission denied

Solution is to fix the permissions on the folder. For example like this:

Code Block
sudo chmod a+w+r /var/lib/postgresql

initdb: command not found

...