Add user-callable CRC functions.
authorNathan Bossart <nathan@postgresql.org>
Mon, 12 Aug 2024 15:35:06 +0000 (10:35 -0500)
committerNathan Bossart <nathan@postgresql.org>
Mon, 12 Aug 2024 15:35:06 +0000 (10:35 -0500)
commit760162fedb4f7ee6f0167cc6acfadee6ccb6be66
tree95564338177e250a12e506473c4e0fe62f9daa7d
parent313df8f5adde186b0052d7d634a6d0ae41852de0
Add user-callable CRC functions.

We've had code for CRC-32 and CRC-32C for some time (for WAL
records, etc.), but there was no way for users to call it, despite
apparent popular demand.  The new crc32() and crc32c() functions
accept bytea input and return bigint (to avoid returning negative
values).

Bumps catversion.

Author: Aleksander Alekseev
Reviewed-by: Peter Eisentraut, Tom Lane
Discussion: https://postgr.es/m/CAJ7c6TNMTGnqnG%3DyXXUQh9E88JDckmR45H2Q%2B%3DucaCLMOW1QQw%40mail.gmail.com
doc/src/sgml/func.sgml
src/backend/utils/hash/pg_crc.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/test/regress/expected/opr_sanity.out
src/test/regress/expected/strings.out
src/test/regress/sql/strings.sql