This forum is no longer active. Please post your questions to our new community site
pgpass in WAPP?
|
|
With Postgres installed from the Postgres site, a file .pgpass exists in order to control ‘auto’ lookups of passwords. That’s how you can connect without supplying a password. I’ve noticed that I can login with postgres and not supply a password, but now that I’ve changed my password, the wrong password is being automatically supplied. How do I change this since I do not see a .pgpass file anywhere on my computer? I can correctly connect if I use the -W paramter with psql. But that forces me to answer a prompt. The only way I know to run a script without answering a prompt is to automatically supply a password. I don’t think Postgres has anything like a -ppassword switch. Thanks, |
|
|
Hi mpugsley, You can provide the password setting the environment variable “PGPASSWORD” before running pgsql
I hope it helps |
|
|
That worked! Thank you, Carlos! Although I haven’t tried it yet, I bet that I could also set an environment variable for PGPASSFILE which specifies the location of .pgpass and then create my own .pgpass. I thought about the PGPASSFILE setting earlier, but I kept looking in the postgresql.conf file for it (which I would then alter). But I never saw it there, and I didn’t think to create an environment variable. And FYI for anyone else who needs this solution, this worked for a WindowsXP box. Thanks again! |

