如何解决身份验证:PostgresSql 13.1 不考虑密码传递部分连接字符串参数
最近我们将 postgres 数据库升级到了 13.1 版。 之后我们面临着连接字符串的奇怪行为
使用 Postgressql 12.3 下面的命令用于成功连接到数据库而不提示输入密码
**postgres=# \connect "dbname=dm_test_db4_db user=test_db4 host=localhost port=5432 password=password";
You are Now connected to database "dm_test_db4_db" as user "test_db4".*
使用 Postgressql 13.1 输入密码提示,如果我们提供密码连接成功。
*postgres=# \connect "dbname=dm_test_db4_db user=test_db4 host=localhost port=5432 password=password";
Password for user test_db4:
You are Now connected to database "dm_test_db4_db" as user "test_db4".*
由于这些命令是 sql 脚本的一部分,没有给出任何输入,脚本因身份验证失败而失败。
这是我的环境详细信息
postgres 版本详情: C:\Program Files\Postgresql\13\bin>postgres.exe -V postgres (Postgresql) 13.1 操作系统:Windows
这些是pg_hba.conf
中的设置 - IPv4 local connections:
host all all 127.0.0.1/32 md5
- IPv6 local connections:
host all all ::1/128 md5
知道是什么导致了这种行为吗?
解决方法
psql
的 13.1 版本(客户端程序,而不是数据库服务器)中存在一个错误。它是fixed in 13.2
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。