diff options
author | Nathan Bossart | 2024-08-12 15:35:06 +0000 |
---|---|---|
committer | Nathan Bossart | 2024-08-12 15:35:06 +0000 |
commit | 760162fedb4f7ee6f0167cc6acfadee6ccb6be66 (patch) | |
tree | 95564338177e250a12e506473c4e0fe62f9daa7d /src/include | |
parent | 313df8f5adde186b0052d7d634a6d0ae41852de0 (diff) |
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
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
-rw-r--r-- | src/include/catalog/pg_proc.dat | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 37c0354ab91..9a0ae278239 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -57,6 +57,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202408121 +#define CATALOG_VERSION_NO 202408122 #endif diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index be37576a34a..4abc6d95262 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -7743,6 +7743,14 @@ proname => 'system', provolatile => 'v', prorettype => 'tsm_handler', proargtypes => 'internal', prosrc => 'tsm_system_handler' }, +# CRC variants +{ oid => '8571', descr => 'CRC-32 value', + proname => 'crc32', proleakproof => 't', prorettype => 'int8', + proargtypes => 'bytea', prosrc => 'crc32_bytea' }, +{ oid => '8572', descr => 'CRC-32C value', + proname => 'crc32c', proleakproof => 't', prorettype => 'int8', + proargtypes => 'bytea', prosrc => 'crc32c_bytea' }, + # cryptographic { oid => '2311', descr => 'MD5 hash', proname => 'md5', proleakproof => 't', prorettype => 'text', |