I'm trying to reset the password of the user 'postgres' on a postgres 9.3 installation, but have been unable to do so...

I've tried every combination in pg_hba.conf I could find online (ex. 'host all all localhost trust'), but when I run 'psql -U postgres' or try to connect via pgAdmin III it asks for a password. If I leave it blank I get an error saying 'psql: fe_sendauth: no password supplied'

Running on a Windows Server 2012 machine.

We are suspecting a corrupt DB/filesystem by the way, so that might have something to do with it, but if you have any suggestions...

  • After changing pg_hba.conf did you restart the PostgreSQL server or use pg_ctl reload? As for corruption: Read and act on this now: wiki.postgresql.org/wiki/Corruption – Craig Ringer Sep 2 '14 at 2:37
  • I restart the postgres windows service after I edit the file.. I also set up a test server and installed postgres 9.3 on that with the same results. Could no reset the password. – WhySoCerial Sep 2 '14 at 6:11
  • What does telnet localhost 5432 respond to you? – dezso Sep 2 '14 at 6:56
  • When you edited pg_hba.conf, did you put the new/altered line first? It needs to be, because the first matching line is used. – Craig Ringer Sep 2 '14 at 7:08
  • Just tried with 'host all all localhost trust' at the top, everything else commented out. It complained about no entry for host ::1, so I added 'host all all ::1/128 trust'. Then I get the error "FATAL: role "postgres" does not exist" when running 'psql -U postgres'. Nothing happens with 'telnet localhost 5432' – WhySoCerial Sep 2 '14 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.