Query about using arrays (for accessing pg_group) - Mailing list pgsql-sql

From Greg Wickham
Subject Query about using arrays (for accessing pg_group)
Date
Msg-id 20000702072023.3C29110E98@mail.surfcoast.net
Whole thread Raw
Responses Re: Query about using arrays (for accessing pg_group)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Howdy,

Am trying to implement a user/group based security model for
accessing a database which is tightly integrated with the postgresql
security model.

The problem I am having is that I am not sure how to check which
groups a user is in.

For example, if I have a user (with id of 21) in a group, I'm not
sure how to start off with the user id and pull out the group name
using normal sql.

If I try the half intuitive approach

z=> select groname from pg_group where grolist = 21;
ERROR:  Unable to identify an operator '=' for types '_int4' and 'int4'       You will have to retype this query using
anexplicit cast
 

The cause of my problem is the use of an array to store the user id's
associated with a group. Not sure how to get around this.

Any ideas?

Please cc replies to me as I think I've fallen off this list.

tia,
  -Greg

------------------------------------------------------------------
www.geelong.com                                       Greg Wickham  P.O. Box 1426
greg@geelong.com
Geelong VIC 3220                             Ph: (+61 407) 854 566
------------------------------------------------------------------
wheNufiNdu'RselFindAngeRwheNu'rThreAtenEdbyAstrAngeRwheNitlOoksLik


pgsql-sql by date:

Previous
From: "Andrey"
Date:
Subject: function
Next
From: Joachim Trinkwitz
Date:
Subject: Re: retrieving a serial number