romantic_collation
romantic_collation · Deterministic natural ordering through binary sort keys.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102364 | romantic_collation | romantic_collation | 1.0 | UTIL | MIT | Zig |
Usage
Sources:
romantic_collation exposes reproducible natural ordering as bytea sort keys. It does not register a PostgreSQL COLLATE provider. The native adapter requires UTF8 database encoding and a library built against the server’s headers; no fixed supported-major list is declared.
Generate and index keys
romantic_key_v1(text, integer DEFAULT 0) is immutable, strict and parallel safe. Use the same option bits in queries and indexed expressions: codepoint mode is 1, decimal parsing 8, scientific notation 32 and Roman-numeral parsing 64. The default provides the library’s natural-order semantics.
Persistence
Keep the key version and options fixed for stored/indexed keys. Recompute affected keys and rebuild expression indexes when changing key semantics; earlier scientific-notation keys are not interchangeable. Equal keys do not prove byte-identical input. Long generated keys can exceed PostgreSQL B-tree key limits. No preload is required.