I run this code as root:

/usr/local/bin/postgres -D /usr/local/pgsql/data

because it wanted me to run it.

However it gives this error;

"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise. See the documentation for
more information on how to properly start the server.

How can I login into PostgreSQL? Isn't it possible to use it with root user?

Some notes: This is PostgreSQL 9.4 (beta, but 9.3 gives me same error) on FreeBSD 10. PostgreSQL was installed via Ports. I think I have a "pgsql" user because it said

===> Registering installation for postgresql94-server-9.4.b3
===> Creating users and/or groups.
Using existing group 'pqsql'.
Using existing user 'pqsql'.
  • 1
    Postgres does this for security reasons. You should log in as the "postgres" user (apparently named pgsql in your installation) and start the server from that user. Oct 20 '14 at 21:01
  • Doesn't it install a README or something with setup instructions? (I don't use FreeBSD). Oct 20 '14 at 21:30
  • @CraigRinger, it gives you several instructions (that most of them work) while installing but one has to be really fast to read, remember and understand what is going on.
    – ilhan
    Oct 20 '14 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.