Skip to content

ruid

Compact 22-character Base64 representation of PostgreSQL UUID values.

pg_ruid · Compact 22-character Base64 representation of PostgreSQL UUID values.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100238ruidpg_ruid0.0.4TYPEUnknownC

PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18

Relationships
Requiresuuid-ossp

Usage

Sources:

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.

CREATE EXTENSION "uuid-ossp";
CREATE EXTENSION ruid;

SELECT ruid_v4();
SELECT '5b0ba39c-6597-11e2-9d36-001b211595d1'::uuid::ruid;

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 PGXN META.json still reports 0.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_path to public even 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.

Table reader