postgresql【二】postgresql强制删除数据库

SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE datname='db_name' AND pid<>pg_backend_pid();

drop database db_name;

posted @ 2019-10-14 18:06  疯子110  阅读(2182)  评论(0编辑  收藏  举报