hash64
pg_hash64 · Stable 64-bit hash function whose results do not change across PostgreSQL major versions.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100232 | hash64 | pg_hash64 | 0.1.0 | FUNC | PostgreSQL | C |
Usage
Sources:
hash64 exposes hash64(text), a stable 64-bit hash returned as bigint. Unlike PostgreSQL’s internal hash functions, upstream promises that its result will remain unchanged across PostgreSQL major releases, making it useful for deterministic sharding or partition assignment in mixed-version deployments.
A hash is not unique and is not a cryptographic authenticator. Always retain the original key for equality checks, allow for collisions, and do not use the result for password storage, signatures, or adversarial integrity checks.
Version 0.1.0 is old and has no current PostgreSQL compatibility matrix. Before using it as a cross-cluster routing contract, build it on every target architecture and verify a fixed corpus of expected outputs; changing integer normalization or platform behavior would otherwise move data between shards.