Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e62Gd6S29727 for ; Sun, 2 Jul 2000 12:39:06 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id MAA05266; Sun, 2 Jul 2000 12:38:47 -0400 (EDT) To: Greg Wickham cc: pgsql-sql@hub.org Subject: Re: Query about using arrays (for accessing pg_group) In-reply-to: <20000702072023.3C29110E98@mail.surfcoast.net> References: <20000702072023.3C29110E98@mail.surfcoast.net> Comments: In-reply-to Greg Wickham message dated "Sun, 02 Jul 2000 17:20:23 +1000" Date: Sun, 02 Jul 2000 12:38:47 -0400 Message-ID: <5263.962555927@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/4 Greg Wickham writes: > 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 an explicit 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. You need a function that will return true if any of the elements of an int4 array is equal to a particular int4 value. See contrib/array/ for one way to do it. regards, tom lane