X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B5E40D1E1F4 for ; Thu, 29 Apr 2004 14:37:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 94410-02 for ; Thu, 29 Apr 2004 14:37:19 -0300 (ADT) Received: from boss.intranet.noze.it (unknown [213.26.229.146]) by svr1.postgresql.org (Postfix) with ESMTP id 1441AD1E607 for ; Thu, 29 Apr 2004 14:37:18 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by boss.intranet.noze.it (Postfix) with ESMTP id C604B262801C; Thu, 29 Apr 2004 19:37:16 +0200 (CEST) Received: from boss.intranet.noze.it ([127.0.0.1]) by localhost (boss.intranet.noze.it [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 11387-10; Thu, 29 Apr 2004 19:37:15 +0200 (CEST) Received: from macbeth.intranet.noze.it (macbeth.intranet.noze.it [192.168.0.70]) by boss.intranet.noze.it (Postfix) with ESMTP id 84C7D262801B; Thu, 29 Apr 2004 19:37:15 +0200 (CEST) Subject: Check a value in array From: Marco Lazzeri To: pgsql-sql@postgresql.org Content-Type: text/plain Message-Id: <1083260230.20352.7.camel@macbeth.intranet.noze.it> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 29 Apr 2004 19:37:11 +0200 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at noze.it X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/319 X-Sequence-Number: 17694 Hi all. I have to check if a value is in an array. I've got a date array 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