Re: [patch] bit XOR aggregate functions

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: David Fetter <david@fetter.org>
Cc: Vik Fearing <vik@postgresfriends.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-06T20:06:26Z
Lists: pgsql-hackers
On Saturday, March 6, 2021, David Fetter <david@fetter.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)?

David J.

Commits

  1. Add bit_xor aggregate function