Received: from acenet.net.au (acemail1.acenet.net.au [203.46.29.38]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA35667 for ; Mon, 14 Feb 2000 16:21:53 -0500 (EST) (envelope-from gordonc@acenet.net.au) Received: from acenet.net.au [203.46.29.19] by acenet.net.au [203.46.29.38] with SMTP (MDaemon.v2.8.5.0.R) for ; Tue, 15 Feb 2000 07:20:16 +1000 Received: from [203.46.29.76] [203.46.29.76] by acenet.net.au [203.46.29.19] with SMTP (MDaemon.v2.8.5.0.R) for ; Tue, 15 Feb 2000 07:14:12 +1000 Date: Tue, 15 Feb 2000 07:13:50 +1000 (EST) From: Gordon Clarke X-Sender: gordonc@localhost.localdomain To: pgsql-sql@postgresql.org Subject: pg_group system table Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: gordonc@acenet.net.au X-MDaemon-Deliver-To: pgsql-sql@postgresql.org X-Return-Path: gordonc@acenet.net.au The pgsql doco mentions that there is no create group command, at least in v6.5.2. Further, that one needs to insert directly into the system table pg_group which is fine. So I retrieved the user id's I needed from pg_user and made the following insert. insert into pg_group(groname, grosysid, grolist) values('dba',50,'{102,101,100}'); Now I want to determine which group(s) a certain user is in. So I tried. select groname from pg_group pg where pg.grolist{} = 101; Which doesn't work, nor does.. select groname from pg_group pg where pg.grolist[] = 101; As well as many other combinations I tried. Too many to list and I'm obviously on the wrong path. However, provided I know where that user id is in the list ie. second, the query works. This is not what I want because I'm not necessarily going to know where that user id is in the list. So how do I write the query in a general way given just the user id and not its position? A way around is to make 3 entries for the above insert and therefore the user id will always be the first and only item in the list, but I don't want to have to resort to that. Cheers...Gordon ~~~~~~~~~~~~~~ 4ZzZ Brisbane's First Community FM Station ~~~~~~~~~~~~~~ The Demo Show - Supporting Australian Unsigned Artists Mon nights 6-7pm (0800-0900UTC) on 4ZzZ 102.1 FM http://www.4zzzfm.org.au/zed (RA feed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~