Skip to content

snowid

64-bit identifiers with UUID text I/O and per-table sequences

pg_snowid · 64-bit identifiers with UUID text I/O and per-table sequences

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102131snowidpg_snowid1.1TYPEC

Usage

Sources:

snowid stores a 64-bit identifier while displaying UUID-shaped text. The high 12 bits encode a table identifier and the low 52 bits encode a sequence; this is not a full 128-bit UUID space.

Core Workflow

CREATE EXTENSION snowid;
CREATE SEQUENCE demo_snowid_seq MAXVALUE 4503599627370495;
SELECT snowid.gen_snowid(1, 'demo_snowid_seq'::regclass);

Operational Boundaries

The SQL installs the snowid type, comparison operators, B-tree/hash support, casts and sequence helpers under snowid. snowid.pack combines components; the two-argument snowid.gen_snowid consumes a chosen sequence. Keep table IDs unique within the intended domain and prevent sequence overflow; bit masking is not collision prevention.

The installation also includes DDL event-trigger machinery for the single-argument generator. Review its effects on defaults and sequences before enabling it in an existing database. Installation needs a superuser. No preload or current PostgreSQL-major support matrix is declared, and no license was found in the reviewed repository.

Table reader