Re: how to obtain the user's group - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: how to obtain the user's group
Date
Msg-id 20030613190741.GC19711@wolff.to
Whole thread Raw
In response to how to obtain the user's group  (miguel angel rojas aquino <mrojas_aquino@mail.flashmail.com>)
List pgsql-general
On Tue, Jun 10, 2003 at 15:02:03 -0500,
  miguel angel rojas aquino <mrojas_aquino@mail.flashmail.com> wrote:
> hi, i'm looking for the way to obtain the group to which belongs a
> database user, something like "SELECT USER" to obtain the current user
> name but for the group. i'm looking in the documentation, but doesn't
> seem to be something like this.
>
> so, any help would be greatly appreciated, thanks and best regards.

The information you want is in pg_user and pg_group. Unfortunately
the list of user ids in a group are stored in an array which makes getting
the login names corresponding to those ids a bit of a pain or if you
are starting with a user finding which groups they are in. In 7.4
the array handling is going to be more powerful (but may still be a contrib)
which might make writing a simple query easy.

pgsql-general by date:

Previous
From: John Smith
Date:
Subject: Lyris -> PG 7.1.3
Next
From:
Date:
Subject: pg 7.1.X