PostgreSQL: changing password for a user is not working

Like willglynn said, it's probably your pg_hba.conf file.

If you have the following line:

local   all    all     peer

then change it to:

local   all    all     md5

That should then let you login with your new password (assuming that you correctly supply it) :)


I just wanted to add that in addition to to changing pg_hba.conf file from

local   all    all     peer

to

local   all    all     md5

As per the accepted answer, the only way I could log in after doing the same thing the OP was doing was to pass the -h flag when trying to login.

$ psql -U postgres -h localhost

Hopefully, this will help someone in the future. It was driving me nuts!