Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id F266B63331D for ; Fri, 8 Jan 2010 12:36:17 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 55320-03 for ; Fri, 8 Jan 2010 16:36:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-px0-f194.google.com (mail-px0-f194.google.com [209.85.216.194]) by mail.postgresql.org (Postfix) with ESMTP id 9CEA0632B74 for ; Fri, 8 Jan 2010 12:36:06 -0400 (AST) Received: by pxi32 with SMTP id 32so13701034pxi.15 for ; Fri, 08 Jan 2010 08:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=KoY9HjdgASbQaQB2MVM4F6LX+OjE/sJ+wZL5rO59N9E=; b=G1TXpQCySPbnt8MONulTLAvep0NGhr1k0VVNi3YLo9Nj3D84N9/+OapdZFqYFFzFFN aYSkHj1rfzkm1sUyy+bAgjFfp/tK22JSdhth2Io31l+yoadraON2WEftImrJwP3DAbbQ ReRvI6x3ax53+1cQOb6dMFgOCxKJ5CILVfAZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=N5i4UZcPNUZvKQxY2evu2uKTVi/bMi+v97pP0njMU4BjUn8DvdJ1W5H4MaEUVn22RJ yaBYyFzIw5eBfEvQPzhbjTm4AB5lRK0uhbW+S4krHBTbyEp506iJP3sIG6+6yNlFDC4h rUq+azNGLKiji5bqEu23eDef1EGCCbVoAPSDQ= MIME-Version: 1.0 Received: by 10.142.59.13 with SMTP id h13mr2843056wfa.3.1262968564451; Fri, 08 Jan 2010 08:36:04 -0800 (PST) In-Reply-To: <4cb7e1b21001080806o443d6e2bxbccc2f6b820395d3@mail.gmail.com> References: <10E4D065260941509531A32BDC0AB647@ramasubramanian> <4cb7e1b21001080806o443d6e2bxbccc2f6b820395d3@mail.gmail.com> Date: Fri, 8 Jan 2010 11:36:04 -0500 Message-ID: Subject: Re: Array comparison From: Merlin Moncure To: Rui Carvalho Cc: ramasubramanian , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.527 tagged_above=-10 required=5 tests=AWL=0.072, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/144 X-Sequence-Number: 37024 On Fri, Jan 8, 2010 at 11:06 AM, Rui Carvalho 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