postgresql - 是否有类似于 mysql 的 $HOME/my.cnf 的 psql 客户端配置文件?

标签 postgresql psql

<分区>

也就是说,客户端计算机上的本地文件具有默认的“主机”、“端口”、“用户”值等,这样我就不必每次都在命令行中输入它们了?

最佳答案

使用 password file像这样的行:

hostname:port:database:username:password

如果你总是登录到同一个 host:db:port:user 那么这将成功:

*:*:*:*:mypassword

关于postgresql - 是否有类似于 mysql 的 $HOME/my.cnf 的 psql 客户端配置文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16422924/

相关文章:

database - Postgresql 删除表如果存在

sql - 在 postgres 的第一个表上左连接预过滤

postgresql - 如何将 PSQL 命令行拆分为多行?

SQLSTATE[08006] [7] 无法将主机名 "dbname="转换为地址

postgresql - 即使删除了某些行,使用种子值进行随机排序也会再次返回相同的集合吗?

postgresql - 使用 distinct on 分组时无法正确排序结果

django - 在 macOS 上通过 psql 创建 PostgreSQL 数据库备份

python - 如何在django db集合自定义查询中选择数据库?

java - pg_dump ProcessBuilder 中的参数太多

ruby-on-rails - 在 Rails 中按月和年分组