postgresql 的 .pgpass密码文件的使用

pgpass 是 连接 postgresql 时使用的密码文件,通常位置为 ~/.pgpass。
在使用某些组件时还真的必须使用。具体的格式为:

hostname:port:database:username:password

常见的使用如下:

# su - postgres
$ vi ~/.pgpass
#hostname:port:database:username:password
192.168.0.102:5432:postgres:postgres:rootroot

~/.pgpass 上的权限必须是600

$ chmod 0600 ~/.pgpass
原文地址:https://www.cnblogs.com/telwanggs/p/11543230.html