您有四个选择来提供密码:
You have four choices to supply a password:
- 设置PGPASSWORD环境变量.有关详细信息,请参见手册:
http://www.postgresql. org/docs/current/static/libpq-envars.html
- 使用.pgpass文件存储密码.有关详细信息,请参见手册:
http://www.postgresql. org/docs/current/static/libpq-pgpass.html
- 对该特定用户使用信任身份验证": http://www.postgresql.org/docs/current/static/auth-methods.html#AUTH-TRUST
- 自PostgreSQL 9.1起,您还可以使用连接字符串:
https ://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
- Set the PGPASSWORD environment variable. For details see the manual:
http://www.postgresql.org/docs/current/static/libpq-envars.html
- Use a .pgpass file to store the password. For details see the manual:
http://www.postgresql.org/docs/current/static/libpq-pgpass.html
- Use "trust authentication" for that specific user: http://www.postgresql.org/docs/current/static/auth-methods.html#AUTH-TRUST
- Since PostgreSQL 9.1 you can also use a connection string:
https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING