https://velog.io/@shj5508/PostgreSQL-테이블-권한-관리하기

테이블 권한 조회

select * from information_schema.role_table_grants where grantee = '{username}';

-- Grantor : 권한을 부여하는 role
-- Grantee : 권한을 부여받은 role
-- Table_schema : schema 명
-- Table_name : table 명
-- Privilege_type : 권한의 유형
-- Is_grantable : 권한을 줄 수 있을 경우 YES, 아닐 경우 NO

스키마 권한 조회

WITH "names"("name") AS (
  SELECT n.nspname AS "name"
    FROM pg_catalog.pg_namespace n
      WHERE n.nspname !~ '^pg_'
        AND n.nspname <> 'information_schema'
) SELECT "name",
  pg_catalog.has_schema_privilege('<계정명>', "name", 'CREATE') AS "create",
  pg_catalog.has_schema_privilege('<계정명>', "name", 'USAGE') AS "usage"
    FROM "names";