PostgreSQL: 権限を確認するSQL


PostgreSQLでどのロールがどのテーブルで何が許可されているかの権限を確認するSQLです。

select grantee, table_name, privilege_type
from information_schema.role_table_grants
where table_schema = 'public' order by grantee, table_name, privilege_type;

実行結果の例

カラム単位の細かい権限の確認したい場合は、次の記事で紹介する方法をご覧ください。