xxhash
pg_xxhash · xxhash functions for PostgreSQL
Overview
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| el8.aarch64 | N/A | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| el9.x86_64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| el9.aarch64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| el10.x86_64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| el10.aarch64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| d12.x86_64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| d12.aarch64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| d13.x86_64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| d13.aarch64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| u22.x86_64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| u22.aarch64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| u24.x86_64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| u24.aarch64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| u26.x86_64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
| u26.aarch64 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 | PIGSTY 0.0.1 |
Source
github.com/hatarist/pg_xxhash
pg_xxhash-0.0.1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
- README.md
- xxhash.control
- xxhash–0.1.0.sql
- xxhash–0.0.1–0.0.2.sql
- xxhash–0.0.2–0.1.0.sql
- CHANGELOG.md
- LICENSE
This documents upstream source version 0.1.0; a published 0.1.0 release was not found in this review, and the catalog’s available packages remain at 0.0.1. The extension supports PostgreSQL 14–19, is relocatable, requires a superuser to enable, and needs no preload or restart.
Functions and representation
The four variants are xxh32, xxh64, xxh3_64, and xxh3_128; xxh128 aliases the last. Each accepts text or bytea, with an optional bigint seed. Text is hashed as bytes in the server encoding; bytea preserves arbitrary binary input including NUL bytes. Unseeded calls use seed 0.
Names without a b suffix return lowercase hexadecimal text of 8, 16, 16, or 32 characters respectively. xxh32b, xxh64b, xxh3_64b, xxh3_128b, and alias xxh128b return canonical big-endian bytea values. Every function is immutable, strict and parallel safe.
XXH32 seeds must be 0–4294967295. Other variants accept any bigint; negative values represent a two’s-complement 64-bit seed. xxh3_64_secret, xxh3_64b_secret, xxh3_128_secret, and xxh3_128b_secret accept a caller-supplied secret of at least 136 bytes, independently of seed-based hashing. Shorter secrets and out-of-range XXH32 seeds raise errors.
Upgrade and limits
After the 0.1.0 library and SQL files are installed, the supplied chain upgrades 0.0.1 through 0.0.2 to 0.1.0. This source version fixes a per-call memory leak and noncanonical 128-bit binary output on big-endian systems. Review stored hash values and dependent indexes when moving from an affected build. It also removes the bundled GPL helper header; the extension code remains MIT and the bundled xxHash library BSD-2-Clause.
xxHash is noncryptographic. Seeds and secrets do not make it suitable for password storage, signatures, or adversarial integrity checks.