Skip to content

Instantly share code, notes, and snippets.

@gareth-cheeseman
Created April 20, 2023 20:34
Show Gist options
  • Save gareth-cheeseman/289b854974af94a2f04a261186fddfd6 to your computer and use it in GitHub Desktop.
Save gareth-cheeseman/289b854974af94a2f04a261186fddfd6 to your computer and use it in GitHub Desktop.
get roles postgres
SELECT
U.rolname
,D.datname
FROM
pg_roles AS U JOIN pg_database AS D ON (D.datdba = U.oid)
WHERE
D.datname = current_database()
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment