How to find all Postgres users who belong to a user group


20
views
0
12 weeks ago by
select
  rolname, pg_user.usename
from pg_user
join pg_auth_members on (pg_user.usesysid=pg_auth_members.member)
join pg_roles on (pg_roles.oid=pg_auth_members.roleid)
where
  pg_roles.rolname = :ROLE_NAME


Borrowed shamelessly from:

https://stackoverflow.com/a/6775658/1278553

Community: Zimmer Biomet

Similar posts:
Search »