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?
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
In Unix-like systems it's
And add the following info in this format:
Restart your shell and you're good to go.