Skip site navigation (1) Skip section navigation (2)

Re: Get uasers Group membership

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 (view raw or flat)
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°

In response to

pgsql-novice by date

Next:From: BluebottleDate: 2005-10-08 20:44:05
Subject: Get uasers Group membership
Previous:From: BluebottleDate: 2005-10-07 23:54:13
Subject: Currval function won't work

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group