Score:0

How do I use the pgpass.conf file to allow promptless connection to a database

us flag

for testing purposes I have a postgres service/database running on my local computer. Right now I am using a batch file to change default userlogin, but I cannot use SET PGPASSWORD to pass along a password.

start cmd /k "chcp 1252 & SET PGUSER=postgres"

With this I just have to type 'psql' into my CMD without the -U postgres flag. As I understand PGPASSWORD was depreciated so the correct way is to create a pgpass.conf file to specify connection paramters, so I have something like this in my file:

localhost:5432:sample:postgres:password

Assuming the file is in the correct place and is formatted correctly, how do I use this file to automaticly connect to the db i need without password prompts. Thanks!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.