I have postgresql 9.2 installed on a windows XP machine. I have lost the postgres password.

I looked at answers given to a similar question asked 6 months ago. The answer given there required the editing of a file pg_hba.conf however I cannot find that file anywhere. Windows search doesn't find it.

I have tried uninstalling the postgreSQL installation but that seems to leave behind the password and security settings as on installing again the step to set the postgres password is missed out.

Help please?

  • I think I found the password stored in plain text in a file called pgpass.conf in the users application data area. However, when I try to use Stackbuilder to create a database i get this error when I enter the password. cretadb: could not connect to database template: could not connect to server: connection refused (xoxoooo274D/10061) is the server running on host "localhost" ( accepting TCP/IP connections on port 5432?
    – nigellaw
    Dec 29, 2012 at 22:35
  • Well, that means the server isn't running. Is the service running? The error message tells you what to check. Dec 31, 2012 at 5:13
  • Ah Craig, it is one thing being told what to check and a completely different thing to know HOW to check it and WHAT to do once you've checked it. I'm struggling to deal with a Windows software installation which seems to have gone wrong: emphasis on the word struggling :)
    – nigellaw
    Dec 31, 2012 at 9:13
  • You have to have a pg_hba.conf. If you don't, Postgres isn't running on your system because it's either not properly installed or you never ran initdb. Feb 4, 2013 at 20:59

1 Answer 1


Having previousley tried to delete PostgreSQL and reinstall it I realise I had neglected to delete the files the uninstall leaves behind. In a Windows XP environment these are found in C:/Program Files/PostgreSQL/9.2 Deleting the remaining files in the directory 9.2 and then deleting the directory PostgreSQL allowed me to perform a completely new install of PostgreSQL without any failures. Of course the new installation process requires input of new passwords, this time I made a note of them :)

Not the answer you're looking for? Browse other questions tagged or ask your own question.