Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. 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 set the password to blank, it didn't give any warnings. Now when I try to log in with a blank password, it gives me an error "fe_sendauth: no password supplied". So now I can't log in - any ideas how I can get access to the db again?

share|improve this question

migrated from Feb 7 '13 at 15:51

This question came from our site for professional and enthusiast programmers.

This blogpost should answer. Full disclosure: it's my blogpost.


If you have access to shell account on the machine PostgreSQL is running, and your shell works as the same user as Postgres itself, or root – solution is easy.

Edit your pg_hba.conf file, and at the beginning of it put:

local all all trust

or (depending on your paranoia):

local all postgres ident

And restart your PostgreSQL (usually something like /etc/init.d/postgres restart).

Afterwards you should be able to connect to Postgres as postgres user without password.

You should note, that if you have choosen the option with “ident” you will be able to connect without password only from shell account named “postgres”.

don't forget to reverse the pg_hba.conf settings when you have reset the password.

share|improve this answer
Sorry for the fuss depesz, I hope you don't mind my summary of your blog post. You are a special user and deserve special treatment but some from outside the postgres world on this site don't know that :) – Jack Douglas Feb 8 '13 at 12:38
No problem at all. I definitely do not feel special, I'm just not in favor of adding yet-another (after all google/bing/whatever caches) copy of the same information. But if someone (like you in this case) wants to add it - I have no problem with it. – user1593 Feb 8 '13 at 13:13
up vote 1 down vote accepted

It really depends on how your cluster is configured...

If you have another administrator user (postgres?) you can just connect and:

ALTER USER username PASSWORD 'new password';

Otherwise you could (temporarily) allow password-less logins in pg_hba.conf (see - search for the word "trust")

share|improve this answer
I just edited giorgiga's post to remove UNENCRYPTED. There is an obvious confusion here, that folks might think it refers to the password supplied in the argument, but in fact it refers to storage. I seem to recall a few very unusual corner cases where it might be appropriate but it is definitely not a good blanket recommendation unless you know very clearly that you need it and why. – Chris Travers Feb 8 '13 at 12:45

Your Answer


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