pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 ?




view thread (4+ messages)  latest in thread

Message-ID: <4A8A7F9A.3070906@gmail.com>
Permalink:  ../4A8A7F9A.3070906@gmail.com/
Also on:    postgresql.org/message-id/4A8A7F9A.3070906@gmail.com

 · 

reply

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