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

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?

share|improve this question
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 '12 at 22:35
Well, that means the server isn't running. Is the service running? The error message tells you what to check. – Craig Ringer Dec 31 '12 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 '12 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. – a_horse_with_no_name Feb 4 '13 at 20:59
up vote 1 down vote accepted

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 :)

share|improve this answer

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.