在某些时候,由于有别的连接,无法删除数据库,这时候用这个
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'xxx'
AND pid <> pg_backend_pid();
在某些时候,由于有别的连接,无法删除数据库,这时候用这个
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'xxx'
AND pid <> pg_backend_pid();