pgsql: Add user-callable CRC functions.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add user-callable CRC functions.
Date: 2024-08-12 15:35:58
Message-ID: E1sdX5S-003rpl-4t@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/760162fedb4f7ee6f0167cc6acfadee6ccb6be66

Modified Files
--------------
doc/src/sgml/func.sgml | 34 +++++++++++++++++++++++++++++++
src/backend/utils/hash/pg_crc.c | 35 +++++++++++++++++++++++++++++++-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 8 ++++++++
src/test/regress/expected/opr_sanity.out | 2 ++
src/test/regress/expected/strings.out | 27 ++++++++++++++++++++++++
src/test/regress/sql/strings.sql | 9 ++++++++
7 files changed, 115 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2024-08-12 17:18:42 pgsql: Log more info when wait-for-catchup tests time out.
Previous Message David Rowley 2024-08-12 11:41:32 pgsql: Fix outdated comments