– 查询当前连接
select * from pg_stat_activity;
- 当前总共正在使用的连接数
select count(1) from pg_stat_activity;
-查询当前所有连接的状态
select datname,pid,application_name,state from pg_stat_activity;
–查询最大连接数
show max_connections;
– 释放空闲连接
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE state=‘idle’;
-修改最大链接数据
alter system set max_connections=1000;
参考资料:https://blog.csdn.net/qq_34817440/article/details/121449322
https://blog.csdn.net/qq_42455809/article/details/112770416