Microsoft Windows [版本 10.0.16299.371]
(c) 2017 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>psql -h 192.168.80.148 -p 5432 -d postgres
psql: FATAL: no pg_hba.conf entry for host "192.168.80.1", user "Administrator", database "postgres"
C:\Users\Administrator>psql -h 192.168.80.148 -p 5432 -d postgres -U postgres
psql: FATAL: no pg_hba.conf entry for host "192.168.80.1", user "postgres", database "postgres"
C:\Users\Administrator>
可以看到,提示中居然有user "Administrator",嘿嘿,想想就明白了:psql登录时,若是没有-U参数,那么psql就取psql所在的操作系统的当前登录的user。