关于PostgreSQL的连接数
确认连接数
SELECT * FROM pg_stat_activity;
确认同时连接数的设定值
SHOW max_connections;
释放连接
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname = 'DB名'
AND pid <> pg_backend_pid();
SELECT * FROM pg_stat_activity;
SHOW max_connections;
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname = 'DB名'
AND pid <> pg_backend_pid();