https://www.postgresql.org/docs/8.3/static/libpq-pgpass.htmlhtml
vi ~/.pgpasssql
輸入如下內容post
hostname:port:database:username:password
chmod 0600 ~/.pgpasspostgresql
而後psql指令 psql -U user -h host 能夠不用密碼htm