且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用命令行参数运行PostgreSQL .sql文件

更新时间:2023-11-29 16:39:46

您有四个选择来提供密码:

You have four choices to supply a password:

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