PostgreSQL常见问题解决
1.删除database
DROP DATABASE viid;
执行上述sql报错信息如下:
ERROR: database " viid " is being accessed by other users DETAIL: There is 1 other session using the database.
原因是有其他的session正在使用该数据库
解决方法:
强制断开连接到这个数据库上的所有连接,再删除数据库
REVOKE CONNECT ON DATABASE dcy_export2 FROM public; SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE datname='dcy_export2' AND pid<>pg_backend_pid();
标签:PostgreSQL,删除,database,数据库,pid,pg From: https://www.cnblogs.com/Fooo/p/17596705.html