This is what I enter:
user@user-computer:/usr/lib/postgresql/9.4/bin$ ./postgres -D /etc/postgresql/9.4/main/
This is what I get:
[4173-1] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
Can anyone help me? should I change permissions on ss-cert...key file?
This can happen when the
postgres
user doesnt belong tossl-cert
usergroup Try addingpostgres
user to the groupssl-cert
make sure that
postgres
is the owner of/var/lib/postgresql/version_no/main
eg:sudo chown postgres -R /var/lib/postgresql/9.6/main/
Run the below code to fix the usergroup issue and fixing the permissions
courtsey to GabLeRoux
The error happens because you're trying to launch PostgreSQL as your own unpriviledged user, and it's not meant to run like that.
Ubuntu provides PostgreSQL packaged in a way that it should be launched with:
or for finer-grained control with
pg_ctlcluster
, see http://manpages.ubuntu.com/manpages/trusty/man8/pg_ctlcluster.8.html