psql 进入命令模式
一、查看连接用户
SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE -- don't kill my own connection! procpid <> pg_backend_pid();
二、回收用户权限
username:连接用户
REVOKE CONNECT ON DATABASE dbname FROM PUBLIC,username;原文链接:https://www.f2er.com/postgresql/196592.html