Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 1 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

Your Answer


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.