1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Add bit_xor aggregate function

This can be used as a checksum for unordered sets.  bit_and and bit_or
already exist.

Author: Alexey Bashtanov <bashtanov@imap.cc>
Reviewed-by: Ibrar Ahmed <ibrar.ahmad@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/9d4582ae-ecfc-3a13-2238-6ab5a37c1f41@imap.cc
This commit is contained in:
Peter Eisentraut
2021-03-06 19:25:45 +01:00
parent 30b26dfac7
commit f9a0392e1c
6 changed files with 73 additions and 11 deletions

View File

@ -19224,6 +19224,33 @@ SELECT NULLIF(value, '(none)') ...
<entry>Yes</entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>bit_xor</primary>
</indexterm>
<function>bit_xor</function> ( <type>smallint</type> )
<returnvalue>smallint</returnvalue>
</para>
<para role="func_signature">
<function>bit_xor</function> ( <type>integer</type> )
<returnvalue>integer</returnvalue>
</para>
<para role="func_signature">
<function>bit_xor</function> ( <type>bigint</type> )
<returnvalue>bigint</returnvalue>
</para>
<para role="func_signature">
<function>bit_xor</function> ( <type>bit</type> )
<returnvalue>bit</returnvalue>
</para>
<para>
Computes the bitwise exclusive OR of all non-null input values.
Can be useful as a checksum for an unordered set of values.
</para></entry>
<entry>Yes</entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>