3

I'm using Mac 10.9.5 and PostgreSQL 9.3.4. I'm following instructions for installing a third-party software package (Instructure Canvas) on my local machine) and the instructions say to execute:

sudo -u postgres createuser $USER
sudo -u postgres psql -c "alter user $USER with superuser" postgres

but upon executing the first command, I get the error

davea$ sudo -u postgres createuser $USER
sudo: unknown user: postgres

Other posts seemed to indicate I needed to prepend a "_" to my "postgres" user, but upon doing so, i get this error ...

davea$ sudo -u _postgres createuser $USER
createuser: could not connect to database postgres: FATAL:  role "_postgres" does not exist

Any ideas what I need to do to get this to work properly?

1 Answer 1

2

It looks like whatever you installed has a system user named _postgres and a PostgreSQL user named postgres. Fun!

Try:

sudo -u _postgres createuser -U postgres myusername

(The numerous messy, conflicting and incompatible PostgreSQL installs used on OS X are a nightmare, argh).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.