Skip site navigation (1) Skip section navigation (2)

Re: array_except -- Find elements that are not common to both arrays

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Ben Chobot <bench(at)silentmedia(dot)com>
Cc: bricklen <bricklen(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: array_except -- Find elements that are not common to both arrays
Date: 2011-09-30 21:12:07
Message-ID: CAHyXU0xfR+TkB36_hA6gg0dcZxBk-nw0g-1GJ4-uwpK86E-NfQ@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Fri, Sep 30, 2011 at 3:15 PM, Ben Chobot <bench(at)silentmedia(dot)com> wrote:
>
> On Sep 30, 2011, at 12:07 PM, bricklen wrote:
>
>> I've been informed that this type of operation is called "symmetric
>> difference"[1], and can be represented by A ∆ B.  A couple of
>> alternative names were proposed, "array_symmetric_difference" and
>> "array_xor".
>> Does anyone have a preference for the name? I assume that this
>> function might potentially be used by others now that it is in the pg
>> lists, so might as well give it an appropriate name now.
>> Is this something that could be written in C to make it faster (I don't know C)
>
> FWIW, speaking as somebody who has no need of this function, "array_xor" is a pretty clear name that indicates what's going to happen.

+1 on this -- was going to suggest until you beat me to it.  I also
for the record really think the array_ prefix on array handling
functions is pretty silly since we support overloading -- greatly
prefer unnest() to array_unnest() etc.  So, how about xor()?

merlin

In response to

Responses

pgsql-performance by date

Next:From: Bobby DewittDate: 2011-09-30 21:29:06
Subject: Re: PostgreSQL-9.0 Monitoring System to improve performance
Previous:From: Ben ChobotDate: 2011-09-30 20:15:43
Subject: Re: array_except -- Find elements that are not common to both arrays

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group