-1

I'm trying to run the createuser command on an MacOS 10.15 installation of Postgres 11.6. I have enabled root but there is no postgres user to su as - there's a _postgres user instead:

dd@finglas:~ $ cat /etc/passwd | grep 'post'
_postfix:*:27:27:Postfix Mail Server:/var/spool/postfix:/usr/bin/false
_postgres:*:216:216:PostgreSQL Server:/var/empty:/usr/bin/false

The $PATH is valid for Postgres tools, and which createuser points to the correct binary:

dd@finglas:~ $ which createuser
/Applications/Postgres.app/Contents/Versions/latest/bin/createuser

I was expecting to be able to execute something like:

dd@finglas:~ createuser dev_user

I can login to Postgres itself as the postgres user, but I'm unable to run a createuser from the terminal. Any suggestions?

0

1 Answer 1

1

The database user defaults to the same name as your operating system user. Try to specify it explicitly:

createuser -U postgres dev_user

If that causes authentication problens, try again as operating system user _postgres.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.