Query grants for a table in postgres

后端 未结 7 658
栀梦
栀梦 2020-12-22 22:19

How can I query all GRANTS granted to an object in postgres?

For example I have table \"mytable\":

GRANT SELECT, INSERT ON mytable TO user1
GRANT UPD         


        
7条回答
  •  温柔的废话
    2020-12-22 23:01

    I already found it:

    SELECT grantee, privilege_type 
    FROM information_schema.role_table_grants 
    WHERE table_name='mytable'
    

提交回复
热议问题