PostgreSql10-常用操作及视图

xiaoxiao2021-02-28  43

#查看数据库中的所有schema SELECT * FROM information_schema.schemata;  #查看某用户的表权限 select * from information_schema.table_privileges where grantee='xttblog'; #查看usage权限表 select * from information_schema.usage_privileges where grantee='xttblog'; #查看存储过程函数相关权限表 select * from information_schema.routine_privileges where grantee='xttblog'; CREATE USER和CREATE ROLE的区别在于,CREATE USER指令创建的用户默认是有登录权限的,而CREATE ROLE没有 #创建schema指定用户,默认当前用户postgres create schema schema1 authorization user1; #更改数据库的owner: alter database imsdb owner to rcb  #把对象的权限赋予系统中的所有角色。 grant all on schema csm_ca to public; grant all on all tables in schema csm_ca to csm_ca; #修改用户密码 alter user user2 with password 'user2'; #role权限描述 create role db_role1 LOGIN; --创建具有登录权限的角色db_role1 create role db_role2 SUPERUSER; --创建具有超级用户权限的角色 create role db_role3 CREATEDB; --创建具有创建数据库权限的角色 create role db_role4 CREATEROLE --创建具有创建角色权限的角色 alter role db_role1 nologin nocreatedb; --修改角色取消登录和创建数据库权限
转载请注明原文地址: https://www.6miu.com/read-2623348.html

最新回复(0)