Re: Array intersection

From: Josh Trutwin <josh(at)trutwins(dot)homeip(dot)net>
To: "Rodrigo De =?UTF-8?B?TGXDs24=?=" <rdeleonp(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Array intersection
Date: 2007-10-17 16:20:42
Message-ID: 20071017112042.03fdce27@sinkhole.intrcomm.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 17 Oct 2007 11:12:27 -0500
"Rodrigo De León" <rdeleonp(at)gmail(dot)com> wrote:

> On 10/17/07, Josh Trutwin <josh(at)trutwins(dot)homeip(dot)net> wrote:
> > nm - I just wrote a function - though curious if this is the most
> > effecient way:
>
> If you only want TRUE or FALSE, you can use '&&':
>
> t=# SELECT '{1,2}'::INT[] && '{2,3}'::INT[];
> ?column?
> ----------
> t
> (1 row)

Is that 8.2 or above? I'm on 8.1.10:

psql=> SELECT '{1,2}'::INT[] && '{2,3}'::INT[];
ERROR: operator does not exist: integer[] && integer[]
HINT: No operator matches the given name and argument type(s). You
may need to add explicit type casts.

Josh

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-10-17 16:21:17 Re: Will UPDATE lock if FROM refers to target table?
Previous Message Rodrigo De León 2007-10-17 16:12:27 Re: Array intersection