最近我们已经将我们的 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 OS: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
知道是什么导致了这种行为吗?