Re: [patch] bit XOR aggregate functions

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "bashtanov(at)imap(dot)cc" <bashtanov(at)imap(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [patch] bit XOR aggregate functions
Date: 2021-03-07 09:36:35
Message-ID: 8081ec73-c971-70c8-244f-242694d20ae8@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/6/21 9:06 PM, David G. Johnston wrote:
> On Saturday, March 6, 2021, David Fetter <david(at)fetter(dot)org> wrote:
>
>>
>>>> SELECT BIT_XOR(b ORDER BY a, c)... /* works */
>>>> SELECT BIT_XOR(b) OVER (ORDER BY a, c)... /* works */
>>>> SELECT BIT_XOR(b) FROM... /* errors out */
>>>
>>>
>>> Why would such an error be necessary, or even desirable?
>>
>> Because there is no way to ensure that the results remain consistent
>> from one execution to the next without such a guarantee.
>>
>
> Numerous existing aggregate functions have this behavior. Making those
> error isn’t an option. So is making this a special case something we want
> to do (and also maybe make doing so the rule going forward)?

Aside from the fact that bit_xor() does not need this, I am opposed to
it in general. It is not our job to make people write correct queries.
--
Vik Fearing

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2021-03-07 09:53:46 Re: [patch] bit XOR aggregate functions
Previous Message Bharath Rupireddy 2021-03-07 09:33:43 Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW