Re: [patch] bit XOR aggregate functions

Vik Fearing <vik@postgresfriends.org>

From: Vik Fearing <vik@postgresfriends.org>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, David Fetter <david@fetter.org>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, "bashtanov@imap.cc" <bashtanov@imap.cc>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-03-07T11:39:38Z
Lists: pgsql-hackers
On 3/7/21 11:37 AM, Pavel Stehule wrote:
> ne 7. 3. 2021 v 11:28 odesílatel Vik Fearing <vik@postgresfriends.org>
> napsal:
> 
>> On 3/7/21 11:24 AM, Pavel Stehule wrote:
>>>>
>>>> And so you are now mandating an ORDER BY on every query and in every
>>>> aggregate and/or window function.  Users will not like that at all.  I
>>>> certainly shan't.
>>>>
>>>
>>> The mandatory ORDER BY clause should be necessary for operations when the
>>> result depends on the order. You need an order for calculation of median.
>>> And you don't need to know an order for average. More if the result is
>> one
>>> number and is not possible to do a visual check of correctness (like
>>> median).
>>
>> The syntax for median (percentile_cont(0.5)) already requires an order
>> by clause.  You are now requiring one on array_agg().
>>
> 
> array_agg is discuttable, because PostgreSQL arrays are ordered set type.
> But very common usage is using arrays instead and unordered sets (because
> ANSI/SQL sets) are not supported. But anyway - for arrays I can do visual
> check if it is ordered well or not.

If by "visual check" you mean "with my human eyeballs" then I would
argue that that is always the case and we don't need nannying for other
aggregates either.
-- 
Vik Fearing



Commits

  1. Add bit_xor aggregate function