ruid
pg_ruid · Compact 22-character Base64 representation of PostgreSQL UUID values.
Overview
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | uuid-ossp |
Usage
Sources:
- README at the reviewed commit
- Extension control file
- Type, operators, indexes, and helper functions
- Repository PGXN metadata
- PGXN distribution page
ruid defines a Readable and Usable Identifier type with the same 16-byte internal value as PostgreSQL uuid but a compact, modified Base64 text representation. A typical value is 22 characters rather than the canonical 36-character UUID form. Binary assignment casts connect the two types without conversion functions, and the extension supplies default B-tree and hash operator classes.
Generate and Convert Identifiers
The extension depends on uuid-ossp for UUID generation and namespace helpers.
Helper functions include ruid_nil, ruid_v1, ruid_v1mc, ruid_v4, and ruid_v5. Namespace constants are exposed by ruid_ns_dns, ruid_ns_oid, ruid_ns_url, and ruid_ns_x500; name-based version-5 helpers are ruid_dns, ruid_oid, ruid_url, ruid_x500, and ruid_sum.
Caveats
- The compact representation changes text interchange only; the database value still occupies 16 bytes like
uuid. External systems must explicitly understand this modified Base64 alphabet. - The control file reports version
0.0.4, while the repository’s PGXNMETA.jsonstill reports0.0.3. The install SQL and control file are the relevant API/version evidence for this catalog entry. - The README lists
ruid_v3, but the reviewed install SQL does not create that function. Do not rely on it without inspecting the installed extension. - The install script explicitly sets
search_pathtopubliceven though the control file says the extension is relocatable. Test non-public-schema installation and relocation rather than assuming extension-schema isolation. - The source and documentation date from 2013 and provide no modern PostgreSQL compatibility matrix. Test dump/restore, casts, indexes, and client decoding on the exact target release.