//查看过期连接
select * from pg_stat_activity where state = 'idle'
//删除连接,括号里传pid
select pg_terminate_backend(25800);
//查看最大连接数
show max_connections;
//修改最大连接数,需要superuser权限
alter system set max_connections= 1000;
本文介绍如何在 PostgreSQL 中检查、终止及调整连接设置。包括查询空闲连接、终止指定连接及更改最大连接数的方法。
//查看过期连接
select * from pg_stat_activity where state = 'idle'
//删除连接,括号里传pid
select pg_terminate_backend(25800);
//查看最大连接数
show max_connections;
//修改最大连接数,需要superuser权限
alter system set max_connections= 1000;
1万+
1118

被折叠的 条评论
为什么被折叠?