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

From Tom Lane
Subject Re: Query about using arrays (for accessing pg_group)
Date
Msg-id 5263.962555927@sss.pgh.pa.us
Whole thread Raw
In response to Query about using arrays (for accessing pg_group)  (Greg Wickham <greg@geelong.com>)
List pgsql-sql
Greg Wickham <greg@geelong.com> 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


pgsql-sql by date:

Previous
From: Joachim Trinkwitz
Date:
Subject: Re: retrieving a serial number
Next
From: Joern Muehlencord
Date:
Subject: case insensitive search