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. It's 100% free, no registration required.

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 recently forgot my PostgreSQL 9.1 password on my windows 8 and it asks for password on pgAdmin III console.

Can I retrieve the password or reset it?

share|improve this question
up vote 4 down vote accepted

After researching, I found that we need to find the pg_hba.conf file under

C:\Program Files\PostgreSQL\9.3\data
  1. Run the notepad++ as administrator (or the editor you usually use to edit the files)
  2. Open the file and at the very bottom, look for

    # TYPE  DATABASE        USER            ADDRESS                 METHOD

    For all the entries for TYPE host, change the METHOD from md5 to trust. Save the file. (Make sure there are no interactions with the database at this moment.)

  3. Press Windows+R to get the run dialog, type services.msc and press enter.

  4. Once you see the services(Local) window, choose a service named "postgresql-x64-9.3 - PostgreSQL Server 9.3" and on the left hand side, restart the service.
  5. Now go back to the pgAdminIII and run the server using default password.
  6. Once you could connect to the server, flip back the settings on the pb_hba.cfg file and save it. Remember before quitting pgAdminIII, do not forget to change the password.

Choose File->Change password to change the password (old password would be a default of postgres).

share|improve this answer
Hey, you could mark your answer as accepted, so the system does not bring it up from time to time as unresolved. – dezso Mar 13 '14 at 10:07
Hey Erwin, just did. Thanks! – startedFromTheBottom Apr 10 '14 at 15:33

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.