#设置禁止连接
UPDATE pg_database SET datallowconn = ‘false‘ WHERE datname = ‘test‘;
#中断会话连接
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = ‘test‘;
#创建数据库及用户 ,用户赋权
create user test01 with password ‘123456‘
create database wangshntest01 owner test01;
grant all PRIVILEGES on database test01 to test01