How do I set a postgresql password in pgpass.conf for the Administrator account on Windows Server 2008?
Posted
by
brad
on Server Fault
See other posts from Server Fault
or by brad
Published on 2012-09-24T01:06:09Z
Indexed on
2012/09/24
3:40 UTC
Read the original article
Hit count: 542
windows-server-2008
|postgresql
I have a pgpass.conf file that works well for my default user. It is in C:/Users/myuser/AppData/Roaming/postgresql/pgpass.conf
. It reads like so;
localhost:5432:*:postgres:password1
I have a process that runs under the Administrator account. When I run whoami
under this process I get nt authority/system
. I want to be able to access the database from this process but it gets stuck because it needs a password. I have tried putting the above pgpass.conf into C:/Users/Administrator/AppData/postgresql/pgpass.conf
and C:/Users/Administrator/AppData/Roaming/postgresql/pgpass.conf
but it does not work. Is this the correct place for this file? Am I even able to do this as the Administrator. Unfortunately I cannot change the user that this process runs under.
© Server Fault or respective owner