为什么

pg为什么

IP:20数据库启动方式

[postgres@localhost ~]$ /usr/local/pgsql/bin/postgres  -D /data/pgsql12/data

1如何检测数据库服务器是否已经允许连接

[root@localhost ~]# netstat -nltp |grep postgres
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      1756/postgres       
tcp6       0      0 ::1:5432                :::*                    LISTEN      1756/postgres       
[root@localhost ~]# /usr/local/pgsql/bin/pg_isready -p 5432
/tmp:5432 - accepting connections

2有了postgresql.conf为什么还会有postgresql.auto.conf文件

通过alter system 命令修改全局配置时。会自动编辑postgresql.auto.conf。数据库启动时会加载postgresql.auto.conf文件。并且覆盖postgresql.conf已有的配置。不要手动修改postgresql.auto.conf。

3如何在修改配置后使配置生效

进入数据库执行

postgres=# select pg_reload_conf();
2023-11-30 20:04:29.370 EST [1756] LOG:  received SIGHUP, reloading configuration files
 pg_reload_conf 
----------------
 t
(1 row)