Server Fault is a question and answer site for system and network administrators. 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

I run PostgreSQL 9.1.9 in Debian Squeeze server (using backports). The contents of pg_hba.conf file is:

local   all             postgres                                trust

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all               md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

host            all     all           md5

I have set the password for postgres user with:

alter user postgres with password 'pass';

I try to make a connection from PgAdmin, but I cannot make it work. It keeps throwing out the authentication failed error. My client is the one with the IP that's shown in the file above. If I change the authentication method to trust and reload postgresql, I connect just fine. The error from the server logs is:

FATAL:  password authentication failed for user "postgres"

What's wrong with my server configuration?

share|improve this question
And if you try with psql? – Milen A. Radev May 13 '13 at 19:23
@MilenA.Radev the same. – Vasilis Lourdas May 14 '13 at 4:41
up vote 3 down vote accepted

Since you mention pgAdmin, if you used it to modify the postgres account, you may suffer from its password expiration's date bug mentioned on in:

PostgreSQL user can not connect to server after changing password

Basically the workaround is:

ALTER USER postgres VALID UNTIL 'infinity';
share|improve this answer
Thank you! You are absolutely right, this was the issue. – Vasilis Lourdas May 14 '13 at 4:46

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.