Re: Issues starting database for the first time on Linux

Tom Lane <[email protected]> Wed, 04 Dec 2019 08:16:46 -0500
Newsgroups gmane.comp.db.postgresql.novice
Message-ID <[email protected]>
Isaac Braham <[email protected]> writes:
...
> chown postgres /usr/local/pgsql/data
> su - postgres
> /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

> pg_ctl -D /usr/local/pgsql/data -l logfile start - leads to "waiting
> for server to start..../bin/sh: logfile: Permission denied stopped
> waiting pg_ctl: could not start server"

Apparently, you haven't got sufficient privilege to create "logfile".
Given that you just did "su - postgres", that seems to mean that
whatever directory is recorded as being postgres' home directory
(look in /etc/passwd to find out) isn't writable by postgres.
Or, maybe there already is a "logfile" there, but it's not
writable by postgres.  Anyway, get the permissions straightened out,
or tell it to write to a log file located someplace else.

			regards, tom lane