在Postgres中查询表的授权 [英] Query grants for a table in postgres
本文介绍了在Postgres中查询表的授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何查询在postgres中授予对象的所有格兰仕?
How can I query all GRANTS granted to an object in postgres?
例如,我有表 mytable:
For example I have table "mytable":
GRANT SELECT, INSERT ON mytable TO user1
GRANT UPDATE ON mytable TO user2
我需要带给我的东西:
user1: SELECT, INSERT
user2: UPDATE
推荐答案
我已经找到了:
SELECT grantee, privilege_type
FROM information_schema.role_table_grants
WHERE table_name='mytable'
这篇关于在Postgres中查询表的授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文