-- 查询连接
select * from pg_stat_activity;
-- 根据pid杀掉连接
select pg_terminate_backend(pid) from pg_stat_activity WHERE datname = '<DBName>';
-- 查询连接
select * from pg_stat_activity;
-- 根据pid杀掉连接
select pg_terminate_backend(pid) from pg_stat_activity WHERE datname = '<DBName>';