Received: from ll.mit.edu (LLMAIL.LL.MIT.EDU [129.55.12.40]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4IFaXA32556 for ; Fri, 18 May 2001 11:36:33 -0400 (EDT) (envelope-from gry@ll.mit.edu) Received: (from smtp@localhost) by ll.mit.edu (8.11.3/8.8.8) id f4IFa1F09721; Fri, 18 May 2001 11:36:01 -0400 (EDT) Received: from UNKNOWN( ), claiming to be "soi.llan" via SMTP by llmail, id smtpdAAAbCaWOr; Fri May 18 11:35:49 2001 Received: from sty (sty [ ]) by soi.llan (8.8.0/8.8.0) with SMTP id LAA04234; Fri, 18 May 2001 11:35:49 -0400 (EDT) Date: Fri, 18 May 2001 11:35:49 -0400 From: george young To: pgsql-sql@postgresql.org Cc: Mart?n Marqu?s Subject: Re: search for groups with a user Message-Id: <20010518113549.7efb161a.gry@ll.mit.edu> In-Reply-To: <0105161149400B.29608@bugs> References: <0105161149400B.29608@bugs> X-Mailer: Sylpheed version 0.4.62 (GTK+ 1.2.8; i586-pc-linux-gnu) Organization: MIT Lincoln Laboratory Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200105/201 X-Sequence-Number: 3018 On Wed, 16 May 2001 11:49:40 +0300 Martín Marqués wrote: > I have to search for which groups a certain user is in. I found out that the > field grolist is of type INT[] (array of integers with reference to the > uids). To search through the array I need a module which is in contrib/array, > which I found, but how do I use it? What do I have to do to be able to do > searches on arrays in the WHERE clause? In postgresq-7.0.3, I did: cd contrib/array make make install [I'm not certain the following is necessary, but if you get errors it might fix things] psql -d yourdb -f array_iterator.sql [or whereever install put it] Then, just try something like: select groname from pg_group g, pg_user u where g.grolist *= u.usesysid and u.usename = 'young' ; groname ------------ supervisor originator operator (3 rows) showing that I'm in those three groups. I hope this helps, -- George -- Your mouse has moved. Windows NT must be restarted for the change to take effect. Reboot now? [OK]