Thread: retrieving user's groups

retrieving user's groups

From
chard
Date:
hello,how will i retrieve group names of a certain user? using sql.

richard







RE: retrieving user's groups

From
Michael Davis
Date:
Here's a start:

select g.groname as group, g.grosysid as group_id, u.usename as user, 
u.usesysid as user_id from pg_group g, pg_user u        where u.usesysid = g.grolist[1] or u.usesysid = g.grolist[2] or

u.usesysid = g.grolist[3] or u.usesysid = g.grolist[4] or u.usesysid = 
g.grolist[5] or              u.usesysid = g.grolist[6] or u.usesysid = g.grolist[7] or 
u.usesysid = g.grolist[8] or u.usesysid = g.grolist[9] or u.usesysid = 
g.grolist[10]        order by groname, usename;


-----Original Message-----
From:    chard [SMTP:chard@hindang.msuiit.edu.ph]
Sent:    Tuesday, January 23, 2001 7:39 PM
To:    pgsql-sql@postgresql.org
Subject:    retrieving user's groups

hello,how will i retrieve group names of a certain user? using sql.

richard