postgresql 最大连接数相关

PG中有一张表记录着当前有多少连接

表名:pg_stat_activity

查询当前连接数:

select count(1) from pg_stat_activity;

查询最大连接数

show max_connections;

最大连接数也可以在pg配置文件中配置:

在postgresql.conf中设置:

max_connections = 500

查看为超级用户保留的连接数:

show superuser_reserved_connections ; 

原文地址:https://www.cnblogs.com/tdsun/p/10448658.html