SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE datname=‘你的数据库名称‘ AND pid<>pg_backend_pid()
postgres 删除数据库连接
原文:https://www.cnblogs.com/ikai/p/14812738.html