Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I tried to follow the "alternative server setup" as detailed here: PostgresSQL, I got the error ERROR: role "$user" does not exist when I ran postgres=# \password $USER and entered my new password. The instructions are very simple, and I followed everything to the letter. Would anyone know what's wrong with my setup?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

It is always best to copy/paste the command and error message so we might check your syntax.

Two thoughts - "$USER" is a variable, you replace it with the user name you wish to use. Also $user is not the same as $USER.

So ...

sudo -u postgres createuser --superuser your_user
sudo -u postgres psql

You should not have a postgres prompt, again change "$USER" to the actual user name you wish to use ...

postgres=# \password your_user

and on ...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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