pg_hba.conf文件指定了允许哪些用户以何种方式连接到PostgreSQL数据库。针对该文件的修改可动态生效(经测试需要重启服务或重新加载)。
1.文件描述
#使用Unix套接字访问
local all postgres peer
local all all peer
#IPV4地址访问
host all all 127.0.0.1/32 trust
#IPv6地址访问
host all all ::1/128 md5
#复制节点访问
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
数据格式:
local DATABASE USER METHOD [OPTIONS]
host DATABASE USE