我pg_hba.conf
的 PostgreSQL-12.6 安装中有这些设置
# "local" is for Unix domain socket connections only
local all all md5
local all postgres trust # ident
# IPv4 local connections:
host all all 127.0.0.1/32 trust # md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
我local all postgres trust
execpt shoudl 允许我在本地登录psql
而无需postgres
以unix 用户身份查询密码。
然而:
postgres@my-vm:/opt/db/postgres/bin> psql
Password for user postgres:
postgres
用户还没有现有的 psql 密码