Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target
Date: 2019-09-18 10:22:28
Message-ID: VisenaEmail.55.62f2e86a7f8136a1.16d43e4b6f1@tc7-visena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

På onsdag 18. september 2019 kl. 12:13:24, skrev Marco Ippolito <
ippolito(dot)marco(at)gmail(dot)com <mailto:ippolito(dot)marco(at)gmail(dot)com>>: Thanks Matthias.
Followed these steps (indicated here:
https://www.postgresql.org/docs/11/creating-cluster.html
<https://www.postgresql.org/docs/11/creating-cluster.html> ) root# chown
postgres /usr/local/pgsql root# su postgres postgres$ initdb -D
/usr/local/pgsql/data postgres(at)pc:/home/marco$
/usr/lib/postgresql/11/bin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locales
COLLATE: en_GB.UTF-8
CTYPE: en_GB.UTF-8
MESSAGES: en_GB.UTF-8
MONETARY: C.UTF-8
NUMERIC: C.UTF-8
TIME: C.UTF-8
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... Europe/Rome
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

/usr/lib/postgresql/11/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
But now permission denied: postgres(at)pc:/home/marco$ sudo
/usr/lib/postgresql/11/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
[sudo] password for postgres:
postgres is not in the sudoers file. This incident will be reported.
postgres(at)pc:/home/marco$ /usr/lib/postgresql/11/bin/pg_ctl -D
/usr/local/pgsql/data -l logfile start
waiting for server to start..../bin/sh: 1: cannot create logfile: Permission
denied
stopped waiting
pg_ctl: could not start server
Examine the log output.
postgres(at)pc:/home/marco$ Start pg_ctl as postgres user, no need to sudo. --
Andreas Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56 963
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com> www.visena.com
<https://www.visena.com> <https://www.visena.com>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marco Ippolito 2019-09-18 10:25:05 Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target
Previous Message Marco Ippolito 2019-09-18 10:13:24 Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target