Thread: PSQL password

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    PSQL password


    I'm a new user of Postgres having used other databases (Oracle, Access) in the past. I've installed PostgreSQL 9.1 for Windows on my Win7 machine and have got it running well although with a few educational hiccups on the way. The only learning resource I could get my hands was via Amazon but that is based on version 8 and so therefore is a little out of date though not too badly.

    In this book, the author takes one through the psql application found in ..9.1\bin. My problem is that when I run this I am asked for a password in the DOS window which I have forgotten. Is there any way I can either retrieve this password or overwrite it? I suspect that the resources in pgAdmin III could cover for this but I would like to use this so far excellent book as closely as possible. I have looked at the postgresql.conf file and that has:-

    #password_encryption = on

    which I read as encryption is not enabled as it is commented out which presumably means that the default is off. According to an earlier post here in 2006 this means that it can be accessed. However that post did not help this dilemma, once again seemingly due to versioning differences.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,777
    Rep Power
    348
    Originally Posted by robinw999
    The only learning resource I could get my hands was via Amazon but that is based on version 8 and so therefore is a little out of date though not too badly.
    Why no use the manual?
    Should contain everything you need: http://www.postgresql.org/docs/current/static/index.html
    And the PostgreSQL wiki: http://wiki.postgresql.org/wiki/Main_Page

    My problem is that when I run this I am asked for a password in the DOS window which I have forgotten.
    It's not a DOS window. PostgreSQL does not run on DOS. It's a Windows commandline

    Is there any way I can either retrieve this password or overwrite it?
    It's one of the Questions in the PostgreSQL FAQ:
    http://wiki.postgresql.org/wiki/FAQ#I_lost_the_database_password.__What_can_I_do_to_recover_it.3F


    And of course if you search for "postgres reset password" you'll get plenty of hints in the internet. Here are some:

    http://forums.devshed.com/postgresql-help-21/reset-superuser-password-228132.html
    http://rationalpie.wordpress.com/2010/02/18/postgresql-reset-root-password/
    http://codingexplorer.wordpress.com/2009/09/28/how-to-reset-postgres-forgotten-password/
    http://pgsnake.blogspot.de/2010/07/postgresql-passwords-and-installers.html
    http://www.tekovic.com/changing-forgotten-postgresql-password
    http://archives.postgresql.org/pgsql-novice/2007-02/msg00061.php
    http://wiki.spry.com/Change_forgotten_PostgreSQL_password
    Last edited by shammat; April 19th, 2012 at 08:39 AM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0
    Thank you Shammat.

IMN logo majestic logo threadwatch logo seochat tools logo