关闭数据库所有连接
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='数据库名' AND pid<>pg_backend_pid();
授权数据库
grant all on database basiclawdev to fescorocktest;
授权schema
grant usage on schema "basiclaw" to fescorocktest;
授权所有表
grant all on all tables in schema "basiclaw" to fescorocktest;
授权所有序列
grant ALL PRIVILEGES ON ALL SEQUENCES in schema "basiclaw" to fescorocktest;
撤销授权数据库
revoke all on database basiclawdev from fescorocktest;
撤销授权schema
revoke usage on schema "basiclaw" from fescorocktest;
撤销授权所有表
revoke all on all tables in schema "basiclaw" from fescorocktest;
撤销授权所有序列
revoke ALL PRIVILEGES ON ALL SEQUENCES in schema "basiclaw" from fescorocktest;