Guest User

Untitled

a guest
Apr 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. select
  2. nsp.nspname as schema_name,
  3. nsp.nspacl as schema_acl,
  4. cls.relname as object_name,
  5. rol.rolname as object_owner,
  6. case cls.relkind
  7. when 'r' then 'TABLE'
  8. when 'm' then 'MATERIALIZED_VIEW'
  9. when 'i' then 'INDEX'
  10. when 'S' then 'SEQUENCE'
  11. when 'v' then 'VIEW'
  12. when 'c' then 'TYPE'
  13. else cls.relkind::text
  14. end as object_type
  15. from pg_catalog.pg_namespace nsp
  16. left join pg_class cls on nsp.oid = cls.relnamespace
  17. left join pg_roles rol on rol.oid = cls.relowner
  18. where nsp.nspname not in ('information_schema', 'pg_catalog') and
  19. nsp.nspname not like 'pg_toast%' AND
  20. nsp.nspacl IS NOT NULL
Add Comment
Please, Sign In to add comment