From: W. Kinastowski <kinastowski@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: operator contains in older Pgsql
Date: Tue, 18 Aug 2009 12:16:58 +0200
Message-ID: <4A8A7F9A.3070906@gmail.com> (raw)
In-Reply-To: <h6dt5n$t9a$3@reversiblemaps.ath.cx>
References: <4A8A5C8C.40809@gmail.com>
<h6dt5n$t9a$3@reversiblemaps.ath.cx>
Jasen Betts wrote:
> On 2009-08-18, W. Kinastowski <kinastowski@gmail.com> wrote:
>
>> I need a functionality of "@>" array operator in 8.1 Pg server. i.ex.
>> SELECT * FROM table WHERE array_col @> ARRAY ['xxx'] (works in 8.2,
>> error in 8.1)
>> How to performe such a query ? Is it possible ? Thanks for help.
>>
>
> SELECT * FROM table WHERE 'xxx' = ANY( array_col )
>
>
>
thanks, it works ... and when there is more elements in array: i.ex
SELECT * FROM table WHERE array_col @> ARRAY ['xxx', 'yyy']
i need to
SELECT * FROM table WHERE 'xxx' = ANY( array_col ) AND 'yyy' = ANY(
array_col )
is that correct ?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: kinastowski@gmail.com
Subject: Re: operator contains in older Pgsql
In-Reply-To: <4A8A7F9A.3070906@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox