From: Emi Lu <emilu@encs.concordia.ca>
To: pgsql-sql@postgresql.org
Subject: Re: How to get all users under a group
Date: Wed, 13 Sep 2006 09:51:48 -0400
Message-ID: <45080CF4.2000802@encs.concordia.ca> (raw)
In-Reply-To: <45070981.3030503@encs.concordia.ca>
References: <45070981.3030503@encs.concordia.ca>
To answer my own question:
SELECT g.groname , u.usename AS "User name"
FROM pg_catalog.pg_user u
left join pg_catalog.pg_group g on(u.usesysid = ANY(g.grolist))
ORDER BY 1, 2;
>
> I know \du+ can get all group info for each user.
>
> Could someone tell me how to get all users under each group please?
>
> such as provide the group name, showing all users under the group.
>
> Thanks,
> Emi
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: emilu@encs.concordia.ca
Subject: Re: How to get all users under a group
In-Reply-To: <45080CF4.2000802@encs.concordia.ca>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox