pg_idkit
Generate UUIDs and KSUIDs inside Postgres, with SQL functions and column defaults.
pg_idkit provides four ID generators and a UUIDv7 timestamp extractor in SQL and PL/pgSQL, without pgcrypto or compiled code. These docs cover version 0.0.4.
Choose an IDCompare UUIDv6, UUIDv7 and two KSUID formats.
Use primary keysDefaults, constraints, collation and pagination.
UUID generatorsSignatures, examples and guarantees.
KSUID generatorsBase62 text IDs with seconds or microseconds fields.
Read timestampsDecode UUIDv7 time and understand timezone handling.
Errors and limitsRandomness, collisions, ordering and time precision.
IDs use Postgres random() and are not secrets. Keep a primary key for uniqueness and a separate timestamp for application dates.
Browse the documentation map or the plain Markdown index.