April 5th, 2006, 07:28 AM
What password is it?
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?
April 6th, 2006, 08:52 AM
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.
Originally Posted by iambaz
April 6th, 2006, 10:31 AM
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.
April 6th, 2006, 11:20 AM
The password is what you set at installation.
Originally Posted by iambaz
April 6th, 2006, 11:40 AM
For the postgres user you can go into users in your control panel and reset the password in there.
April 6th, 2006, 12:13 PM
Doesn't it store that (old) password somewhere in the registry? If this is the case you should change it there also.
Originally Posted by Viper_SB
April 10th, 2006, 10:29 AM
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.
April 10th, 2006, 10:50 AM
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.
April 10th, 2006, 10:55 AM
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.
April 10th, 2006, 10:59 AM
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!!!!