1

I have a postgres instance on Amazon RDS and I want to store the login path so I don't have to remember the host name/username/password to log in each time. In mysql I can simply create a login_path. Is there a postgres equivalent I'm not seeing. What is a common approach to avoid this problem?

1 Answer 1

1

You can use OS environment variables or setup the pgpass configuration file

Set the values for the following OS envvars:

PGHOST, PGPORT, PGDATABASE, PGUSERNAME, PGPASSWORD

Or, do it in a file:

In Windows, create/edit the file %appdata%\postgresql\pgpass.conf

In Unix-like systems it's ~/.pgpass

And add the following info in this format:

hostname:port:database:username:password 

Restart your shell and you're good to go.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.