Re: Query about using arrays (for accessing pg_group)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Wickham <greg(at)geelong(dot)com>
Cc: pgsql-sql(at)hub(dot)org
Subject: Re: Query about using arrays (for accessing pg_group)
Date: 2000-07-02 16:38:47
Message-ID: 5263.962555927@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Greg Wickham <greg(at)geelong(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message tjk@tksoft.com 2000-07-03 06:58:39 Re: case insensitive search
Previous Message Joachim Trinkwitz 2000-07-02 12:28:57 Re: retrieving a serial number