Last Updated: February 25, 2016
·
798
· keerati

.pgpass ftw!

It is useful when you want to do automatically backup database in my case.
(I use Fabric to run the command.)

What you need to do is creating .pgpass in your home directory of the account you are using to backup your database.

The example of the content in .pgpass shows as below.

localhost:5432:[databasename]:[databaseuser]:[databaseuserpassword]

ref: http://stackoverflow.com/questions/2893954/how-to-pass-in-password-to-pg-dump