is a user in a group? 
Author Message
 is a user in a group?
I need to find out a quick way to check which groups a user
is member of.

In the pg_group table each group row has an array of
userids of the members of the group.
At the moment I am selecting all the rows than
searching in each array for the id of the user
I am looking for.

There should be something more elegant than this!!!
There should be a system table which I can use to find
the relation between user and groups.

I would be very grateful to anyone who can help me:-).

Bye,
Jacopo



Tue, 29 Apr 2003 22:31:41 GMT
 is a user in a group?

Quote:
Jacopo Silva writes:
> There should be something more elegant than this!!!

Correct.  And soon we'll implement something.

Quote:
> There should be a system table which I can use to find
> the relation between user and groups.

And that is how we'll do it.

Quote:
> I would be very grateful to anyone who can help me:-).

Sorry, at the moment there's no bettter way.

--



Wed, 30 Apr 2003 00:26:21 GMT
 is a user in a group?
Hi,

You need create a function use PLPGSQL(or PL/Perl) say:

ismember(groupname,username) return bool

since select grolist from pg_group where proname=groupname will return
you an array,
you can use a loop compare each element with the id from usesysid from
pg_user which match username.

Quote:

> I need to find out a quick way to check which groups a user
> is member of.

> In the pg_group table each group row has an array of
> userids of the members of the group.
> At the moment I am selecting all the rows than
> searching in each array for the id of the user
> I am looking for.

> There should be something more elegant than this!!!
> There should be a system table which I can use to find
> the relation between user and groups.

> I would be very grateful to anyone who can help me:-).

> Bye,
> Jacopo

--
Jie LIANG

Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873


www.ipinc.com



Wed, 30 Apr 2003 02:09:15 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. The User Group News: South Florida Informix User Group meeting

2. Informix User Group - Forum 2000 - A Two Day User Group Technical

3. Copy permissions from user/group to different user/group

4. How to create a User Limit for user-group

5. DataWarehouseForum serves as an on-line user group for current and prospective data warehouse users

6. DataWarehouseForum serves as an on-line user group for current and prospective data warehouse users

7. IBM's Commitment to Informix Users - WAIUG User Group Meeting

8. Solutions for Informix Users - A Two-Day User Group Technical Conference

9. VFP Data Grouping - am I going mad ??

10. User group for uniVerse users

11. DataWarehouseForum serves as an on-line user group for current and prospective data warehouse users

12. DataWarehouseForum serves as an on-line user group for current and prospective data warehouse users


 
Powered by phpBB® Forum Software