pgx_ulid
pgx_ulid · ulid type and methods
Overview
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| See Also | pg_uuidv7 sequential_uuids snowflake pg_idkit pg_uuid_v8 uuid-ossp typeid permuteseq |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| el8.aarch64 | N/A | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| el9.x86_64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| el9.aarch64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| el10.x86_64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| el10.aarch64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| d12.x86_64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| d12.aarch64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| d13.x86_64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| d13.aarch64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| u22.x86_64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| u22.aarch64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| u24.x86_64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| u24.aarch64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| u26.x86_64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
| u26.aarch64 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 | PIGSTY 0.3.1 |
Source
github.com/pksunkara/pgx_ulid
pgx_ulid-0.3.1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
pgx_ulid 0.3.1 provides a binary ulid type, generators and casts to and from timestamp and uuid. The tag uses pgrx 0.20.1 and offers PostgreSQL 15–19 build features. The control file establishes the canonical extension name even though one README example uses the shorter name ulid.
Generate and Query IDs
Installation requires a superuser. Ordinary generation and casts do not need preload. Casting a timestamp to ULID creates a zero-filled value with the timestamp prefix; choose interval boundaries appropriate to the application’s query.
Monotonic Generation
Only the monotonic generator requires shared memory. Preserve other preload entries, add the library and restart:
gen_monotonic_ulid() uses shared memory and an LWLock to retain the last generated value. It can raise an error on overflow. This is an instance-local generator, not a cross-cluster ordering guarantee. Installing another binary version is separate from migrating an existing database; inspect the available extension update paths before changing SQL objects.
Version 0.3.1
The release adds an implicit cast from exactly 16 bytes to ulid; invalid lengths raise an error. Generators and min/max aggregates are now declared parallel safe, and the B-tree operator family enables index deduplication. After installing matching files and replacing sessions that loaded the old library, apply the supplied SQL update; preloaded instances require a restart.
The tag includes both 0.2.3-to-0.3.0 and 0.3.0-to-0.3.1 update scripts. Verify that the installed package includes the required path before updating an older database.