Check a value in array

From: Marco Lazzeri <marcomail(at)noze(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Check a value in array
Date: 2004-04-30 08:20:56
Message-ID: 1083313255.7732.7.camel@macbeth.intranet.noze.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.

In _PostgreSQL 7.3.5_, I have to check if a value is in an array.

I've got an array of dates (date[]) in a table and I would like to
perform queries like:

SELECT * FROM table WHERE date IN dates_array;

I've tried using array_contains_date (contrib/array_iterator.sql)
function unsuccessfully:

SELECT array_contains_date(dates_array, date);

WARNING: plpgsql: ERROR during compile of array_contains_date near line
5. ERROR: missing .. at end of SQL expression

Anyone can help me?
Thanks,
Marco

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2004-04-30 13:03:59 Re: Unable to use index?
Previous Message Gregory S. Williamson 2004-04-30 08:14:38 Re: "Idle in Transaction" and hung connections