psql -U postgres -h 127.0.0.1 postgres
I am using the above command to connect to the postgres running on my system. It asks for password
Whereas I have setup .pgpass file in the current directory with content -
127.0.0.1:5432:postgres:postgres:bittu Ideally it should have taken the password - bittu
from the .pgpass file rather than asking me. I am not sure what setup is missing for the .pgpass
file.
Asked
Active
Viewed 2,708 times
1
bittu
- 11
1 Answers
1
Bearing in mind that this is a local psql connection: If your .pgpass file is not in your home directory you'll want to set the PGPASSFILE variable with the .pgpass location or move it to your home directory.
For future reference: If you were adding remote connection info to your .pgpass I'd say double check your host entry in your .pgpass.
sharpgeek
- 21