代码改变世界

创建数据库和普通用户

2022-06-01 22:05  abce  阅读(40)  评论(0编辑  收藏  举报

创建数据库和普通用户

create database test;
create user abce with password 'xxxxxx';
grant all on database test to abce;
alter user abce with valid until 'infinity';
revoke connect on database test from public;

  

查看用户权限

postgresql=#> \du
或者
select table_catalog, table_schema, table_name, privilege_type from information_schema.table_privileges where grantee = 'abce';