Skip to content

Instantly share code, notes, and snippets.

@0xBigBoss
Created January 13, 2024 02:50
Show Gist options
  • Save 0xBigBoss/69ccfb61fc9a8d6ce62b87fcdeed1160 to your computer and use it in GitHub Desktop.
Save 0xBigBoss/69ccfb61fc9a8d6ce62b87fcdeed1160 to your computer and use it in GitHub Desktop.
SELECT
grantee,
specific_schema,
routine_name,
privilege_type
FROM
information_schema.routine_privileges
WHERE
specific_schema NOT IN ('pg_catalog', 'information_schema');
SELECT
defaclrole::regrole AS role,
nspname AS schema,
defaclobjtype AS object_type,
defaclacl AS default_privileges
FROM
pg_default_acl
JOIN
pg_namespace ON pg_default_acl.defaclnamespace = pg_namespace.oid;
SELECT
grantee,
table_schema,
table_name,
privilege_type
FROM
information_schema.table_privileges
WHERE
table_schema NOT IN ('pg_catalog', 'information_schema');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment