Skip to content

Instantly share code, notes, and snippets.

@blacktrub
Last active October 2, 2018 09:50
Show Gist options
  • Select an option

  • Save blacktrub/5b11989d7e4db5486d276b3f87b9164f to your computer and use it in GitHub Desktop.

Select an option

Save blacktrub/5b11989d7e4db5486d276b3f87b9164f to your computer and use it in GitHub Desktop.
# create .pgpass in your home directory with same content
localhost:5432:your_db_name:your_db_username:password
# set required permissions for this file
sudo chmod 600 .pgpass
# set PGPASSFILE variable in your .bashrc or in .zshrc
export PGPASSFILE='/home/your_user/.pgpass'
# test your .pgpass
psql -h host -U your_db_username -d your_db_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment