Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- nsp.nspname as schema_name,
- nsp.nspacl as schema_acl,
- cls.relname as object_name,
- rol.rolname as object_owner,
- case cls.relkind
- when 'r' then 'TABLE'
- when 'm' then 'MATERIALIZED_VIEW'
- when 'i' then 'INDEX'
- when 'S' then 'SEQUENCE'
- when 'v' then 'VIEW'
- when 'c' then 'TYPE'
- else cls.relkind::text
- end as object_type
- from pg_catalog.pg_namespace nsp
- left join pg_class cls on nsp.oid = cls.relnamespace
- left join pg_roles rol on rol.oid = cls.relowner
- where nsp.nspname not in ('information_schema', 'pg_catalog') and
- nsp.nspname not like 'pg_toast%' AND
- nsp.nspacl IS NOT NULL
Add Comment
Please, Sign In to add comment