Re: [patch] bit XOR aggregate functions

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, bashtanov(at)imap(dot)cc
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [patch] bit XOR aggregate functions
Date: 2021-03-03 14:30:15
Message-ID: ca112cc2-37e0-6f0b-5f0e-5d5fcadafd9d@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10.02.21 06:42, Kyotaro Horiguchi wrote:
> We already had CREATE AGGREATE at the time, so BIT_XOR can be thought
> as it falls into the same category with BIT_AND and BIT_OR, that is,
> we may have BIT_XOR as an intrinsic aggregation?

I think the use of BIT_XOR is quite separate from BIT_AND and BIT_OR.
The latter give you an "all" or "any" result of the bits set. BIT_XOR
will return 1 or true if an odd number of inputs are 1 or true, which
isn't useful by itself. But it can be used as a checksum, so it seems
pretty reasonable to me to add it. Perhaps the use case could be
pointed out in the documentation.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-03-03 14:33:05 Re: contrib/cube - binary input/output handlers
Previous Message Dilip Kumar 2021-03-03 14:26:06 Re: [Patch] ALTER SYSTEM READ ONLY