删除数据库失败,提示:there is 1 other session using the database
解决办法:
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity WHERE datname='test_database'
AND pid<>pg_backend_pid();
使用上述命令先关闭活跃的连接用户
此时再执行:DROP DATABASE test_database;
删除数据库失败,提示:there is 1 other session using the database
解决办法:
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity WHERE datname='test_database'
AND pid<>pg_backend_pid();
使用上述命令先关闭活跃的连接用户
此时再执行:DROP DATABASE test_database;