Re: Array comparison

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Rui Carvalho <rui(dot)hmcarvalho(at)gmail(dot)com>
Cc: ramasubramanian <ramasubramanian(dot)g(at)renaissance-it(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Array comparison
Date: 2010-01-08 16:36:04
Message-ID: b42b73151001080836h1bc7faddk9bf62816c252d507@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Jan 8, 2010 at 11:06 AM, Rui Carvalho <rui(dot)hmcarvalho(at)gmail(dot)com> wrote:
> Hi
>
> well it's pretty simple
>
> if you want to see if there are elements in common then instead of "any" use
> "&&"
> if you want to see if they are equal just use " = " that will five you true
> or false

you also have the option of expanding the array into a set and using
standard query techniques. w/8.4, you can use the built in
unnest()...for earlier versions you have to create it yourself
(trivially done):

http://archives.postgresql.org/pgsql-patches/2008-03/msg00308.php

merlin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Carlo Stonebanks 2010-01-08 17:06:14 Re: Massive table (500M rows) update nightmare
Previous Message Rui Carvalho 2010-01-08 16:06:44 Re: Array comparison