Glam Prestige Journal

Bright entertainment trends with youth appeal.

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.

1 Answer

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy