Skip to content

hamming

Rust/pgrx extension providing a Hamming-distance operator for bytea plus an unfinished experimental IVF index access method.

hamming · Rust/pgrx extension providing a Hamming-distance operator for bytea plus an unfinished experimental IVF index access method.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100851hamminghamming0.1.0RAGUnknownRust

PostgreSQL · 11, 12, 13, 14, 15, 16

Usage

Sources:

hamming 0.1.0 provides hamming_distance(bytea, bytea) and the <#> operator for byte-level Hamming comparisons.

Sequential comparison

CREATE EXTENSION hamming;
SELECT hamming_distance(decode('0f', 'hex'), decode('f0', 'hex'));
SELECT decode('0f', 'hex') <#> decode('f0', 'hex');

Both calls return 8 for these one-byte inputs. The stable useful surface is the function and operator evaluated by a normal scan.

Caveats

  • Do not create an ivf index. The access method is a nonfunctional prototype: its build callback does not index tuples, several required callbacks abort when called, and insertion support is absent.
  • The README’s index example therefore does not provide approximate-nearest-neighbour search or durable index storage.
  • The control file marks the extension as untrusted and requiring superuser installation. Limit installation and upgrades to reviewed builds.
  • The Rust package targets pgrx 0.10.2 and advertises PostgreSQL 11 through 16 only. There is no compatibility evidence for newer majors and no published license.

Table reader