From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: operator contains in older Pgsql
Date: 18 Aug 2009 11:18:10 GMT
Message-ID: <h6e2li$9u$1@reversiblemaps.ath.cx> (raw)
References: <4A8A5C8C.40809@gmail.com>
<h6dt5n$t9a$3@reversiblemaps.ath.cx>
<4A8A7F9A.3070906@gmail.com>
On 2009-08-18, W. Kinastowski <kinastowski@gmail.com> wrote:
> 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 ?
it looks good it to me.
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: jasen@xnet.co.nz
Subject: Re: operator contains in older Pgsql
In-Reply-To: <h6e2li$9u$1@reversiblemaps.ath.cx>
* 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