From: | Andreas Kretschmer <akretschmer(at)spamfence(dot)net> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Get uasers Group membership |
Date: | 2005-10-08 05:30:52 |
Message-ID: | 20051008053052.GA1007@kaufbach.delug.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Bluebottle <luckychap(at)bluebottle(dot)com> schrieb:
> In an application I want to confirm that a person is a member of a group eg I
> am looking for a function that receives the userid and groupname, and returns a
> Boolean yes/no answer. Alternatively, is there a way of listing the members of
> a groups ( from which I can write my own function)?
Hi,
pg_group contains information about groups and users. The fild
'groname' is the name, and grolist is a array of user id's in this
group.
You should select the usesysid from pg_user and then you can search this
id in pg_group. (select ... where $ID in any(grolist);)
untestet, i havn't groups here in my local instalation)
Btw.: dont't write HTML in Mailinglists, please.
Regards, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
From | Date | Subject | |
---|---|---|---|
Next Message | Bluebottle | 2005-10-08 20:44:05 | Get uasers Group membership |
Previous Message | Bluebottle | 2005-10-07 23:54:13 | Currval function won't work |