pgx_ulid
ulid type and methods
pgx_ulid : ulid type and methods
Overview
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-- | No | Yes | Yes | Yes | no | no |
| Relationships | |
|---|---|
| See Also | pg_uuidv7 sequential_uuids snowflake pg_idkit pg_uuid_v8 uuid-ossp typeid permuteseq |
shared_preload_libraries = pgx_ulid is only required for gen_monotonic_ulid(); other functions work without it.
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.2.3 |
18 17 16 15 14 | pgx_ulid |
- |
| RPM | PIGSTY | 0.2.3 |
18 17 16 15 14 | pgx_ulid_$v |
- |
| DEB | PIGSTY | 0.2.3 |
18 17 16 15 14 | postgresql-$v-pgx-ulid |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| el8.aarch64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| el9.x86_64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| el9.aarch64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| el10.x86_64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| el10.aarch64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| d12.x86_64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| d12.aarch64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| d13.x86_64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| d13.aarch64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| u22.x86_64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| u22.aarch64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| u24.x86_64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| u24.aarch64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| u26.x86_64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
| u26.aarch64 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 | PIGSTY 0.2.3 |
Source
github.com/pksunkara/pgx_ulid
pgx_ulid-0.2.3.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
pgx_ulid provides a native ulid type, generators, and casts to and from timestamp and uuid. The README documents binary storage and monotonic ULID support. The pgext catalog tracks package and extension name pgx_ulid, version 0.2.3, for PostgreSQL 14-18.
Enable the extension
Generate ULIDs
gen_monotonic_ulid() needs:
The README explicitly says this preload requirement only affects gen_monotonic_ulid(); the rest of the extension works without it.
Use ulid as a primary key
Casts and range queries
The README also documents casts between ulid and uuid.
Caveats
- Monotonic ULIDs use shared memory plus an LWLock to keep the last generated value.
- The README notes that monotonic generation can theoretically overflow and raise an error, although it treats this as negligible in practice.
- The upstream README also shows
CREATE EXTENSION ulid; this stub followsdb/extension.csv, where the package and lead extension are bothpgx_ulid. - The GitHub release page lists
v0.2.3as latest and only labels itRelease 0.2.3, with no separate user-facing release notes.