PostgreSQL有两个重要的全局配置文件,都位于初始化数据目录中
postgresql.conf :负责配置文件位置、资源限制、集群复制等
pg_hba.conf :负责客户端的连接和认证
[root@instance-795y2mib data]# ls -l /pgdata/10/data |grep conf
-rw------- 1 postgres postgres 4513 Mar 28 00:11 pg_hba.conf --数据库实例的“防火墙”
-rw------- 1 postgres postgres 1636 Mar 28 00:11 pg_ident.conf
-rw------- 1 postgres postgres 88 Mar 28 00:11 postgresql.auto.conf
-rw------- 1 postgres postgres 22828 Mar 28 00:11 postgresql.conf
0,查看配置
查询pg_settings系统表
SELECT name,setting FROM pg_settings where name ~ ‘xxx’;\ ELECT current_setting(name);
show all 命令查看
一,pg_hba.conf 数据库实例的“防火墙”
# TYPE DATABASE USER ADDRESS METHOD host all all 127.0.0.1/32 trust host replication all ::1/128 trust # local DATABASE USER METHOD [OPTIONS] # host DATABASE USER ADDRESS METHOD [OPTIONS] # hostssl DATABASE USER ADDRESS METHOD [OPTIONS] # host