比如删除test数据库
登陆终端,执行
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE datname='test' AND pid<>pg_backend_pid();
drop database test;
即可删除test数据库
比如删除test数据库
登陆终端,执行
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE datname='test' AND pid<>pg_backend_pid();
drop database test;
即可删除test数据库