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

    Join Date
    Mar 2003
    Posts
    27
    Rep Power
    0

    What password is it?


    Hi,

    I have been running postgresql fine for a week or two now on my windows xp machine (using the latest edition).

    However, I now need to dump a database using the pg_dump command. The problem is when I run the command through the command line, it asks me for a password. I have no idea what the password is. Somebody told me its my win xp login password but I dont have one. I have tried uninstalling and reinstalling about 10 times - deleting data dir, but always it asks for this password. Its driving me mad!

    Could anybody shed any light on this?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    140
    Rep Power
    28
    Originally Posted by iambaz
    Hi,

    I have been running postgresql fine for a week or two now on my windows xp machine (using the latest edition).

    However, I now need to dump a database using the pg_dump command. The problem is when I run the command through the command line, it asks me for a password. I have no idea what the password is. Somebody told me its my win xp login password but I dont have one. I have tried uninstalling and reinstalling about 10 times - deleting data dir, but always it asks for this password. Its driving me mad!

    Could anybody shed any light on this?
    Postgres creates a windows user called "postgres" and runs its service as this user. The password is the password for this user, not your password.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    27
    Rep Power
    0
    Thanks for the info, I definately dont know this password. Is there any way to reset this? I have tried reinstalling postgres and installing the service with a different name/username but it still asks for the other password.

    Thanks
  6. #4
  7. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
    Originally Posted by iambaz
    Thanks for the info, I definately dont know this password. Is there any way to reset this? I have tried reinstalling postgres and installing the service with a different name/username but it still asks for the other password.

    Thanks
    The password is what you set at installation.
  8. #5
  9. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    For the postgres user you can go into users in your control panel and reset the password in there.
  10. #6
  11. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
    Originally Posted by Viper_SB
    For the postgres user you can go into users in your control panel and reset the password in there.
    Doesn't it store that (old) password somewhere in the registry? If this is the case you should change it there also.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    27
    Rep Power
    0
    Thanks for the help but i have pretty much give up on this to try and keep my sanity. I installed a fresh windows on a fresh computer, installed postgres completely fresh, remembered service and database and windows user/pass's but once again command line commands are asking me for a password which I dont have. What's more I have checked the windows users and the only account listed is the main admin account and not the new postgres one it said it was creating. (Though the program still asks for the password for user Barry - my name - but an account i simply didn't create on that machine!!!) Arrrgh!

    Anyway, quick question, is there any way i can do a database dump using pgAdmin3 that omits user ownership of the tables? I need to copy a database to another machine but when i try it always has owners and ACL which i dont want.

    Thanks guys
  14. #8
  15. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    Yes when you do an export (backup) set the format to PLAIN and select No owner, OR set the format to TAR and then when IMPORTING select "no owner".

    But the password it's asking you for is set on about the second screen of the PG install. It is NOT the postgres user password.
  16. #9
  17. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
    Run pg_dump --help from the command line, you'll see that you can set the user, password and all other needed options, the vanilla run you used supposes that the current os user you are connected with exists in PostgreSQL also and asks a password for it, infact if you input some casual words you'll get an error related to failed auth for "your_current_user_here" connecting to database "your_current_user_here", if you input the actual password for current user you might get an error saying that connection has been successful but database "your_current_user_here" does not exist.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    27
    Rep Power
    0
    AH! Clicked! Thanks for the help guys, I have changed the user from the default and all is now fine, thanks a lot for the help, you have saved me another day of banging the keyboard and kicking the tower with frustration!!!!

IMN logo majestic logo threadwatch logo seochat tools logo