小编给大家分享一下查看postgresql用户权限的方法,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!

1、查看某用户的表权限

select*frominformation_schema.table_privilegeswheregrantee='user_name';

2、查看usage权限表

select*frominformation_schema.usage_privilegeswheregrantee='user_name';

3、查看存储过程函数相关权限表

select*frominformation_schema.routine_privilegeswheregrantee='user_name';

4、建用户授权

createuseruser_name;alteruseruser_namewithpassword'';alteruseruser_namewithCONNECTIONLIMIT20;#连接数限制

看完了这篇文章,相信你对查看postgresql用户权限的方法有了一定的了解,想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!