Re: how to obtain the user's group

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: miguel angel rojas aquino <mrojas_aquino(at)mail(dot)flashmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to obtain the user's group
Date: 2003-06-13 19:07:41
Message-ID: 20030613190741.GC19711@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 10, 2003 at 15:02:03 -0500,
miguel angel rojas aquino <mrojas_aquino(at)mail(dot)flashmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Larry Rosenman 2003-06-13 19:12:28 Re: pg 7.1.X
Previous Message danfisher 2003-06-13 19:07:21 pg 7.1.X