pg_slug_gen
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_slug_gen | 1.0.0 | FUNC | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4560 | pg_slug_gen | No | Yes | No | Yes | No | Yes | - |
| Related | base36 base62 pg_base58 pg_hashids typeid url_encode |
|---|
Version
| OS / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 1.0.0 el8.x86_64.pg18 : pg_slug_gen_18 pg_slug_gen_18-1.0.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0.0 el8.x86_64.pg17 : pg_slug_gen_17 pg_slug_gen_17-1.0.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0.0 el8.x86_64.pg16 : pg_slug_gen_16 pg_slug_gen_16-1.0.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0.0 el8.x86_64.pg15 : pg_slug_gen_15 pg_slug_gen_15-1.0.0-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | N/A | PIGSTY 1.0.0 el8.aarch64.pg18 : pg_slug_gen_18 pg_slug_gen_18-1.0.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0.0 el8.aarch64.pg17 : pg_slug_gen_17 pg_slug_gen_17-1.0.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0.0 el8.aarch64.pg16 : pg_slug_gen_16 pg_slug_gen_16-1.0.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0.0 el8.aarch64.pg15 : pg_slug_gen_15 pg_slug_gen_15-1.0.0-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 1.0.0 el9.x86_64.pg19 : pg_slug_gen_19 pg_slug_gen_19-1.0.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg18 : pg_slug_gen_18 pg_slug_gen_18-1.0.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg17 : pg_slug_gen_17 pg_slug_gen_17-1.0.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg16 : pg_slug_gen_16 pg_slug_gen_16-1.0.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg15 : pg_slug_gen_15 pg_slug_gen_15-1.0.0-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 1.0.0 el9.aarch64.pg19 : pg_slug_gen_19 pg_slug_gen_19-1.0.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg18 : pg_slug_gen_18 pg_slug_gen_18-1.0.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg17 : pg_slug_gen_17 pg_slug_gen_17-1.0.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg16 : pg_slug_gen_16 pg_slug_gen_16-1.0.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg15 : pg_slug_gen_15 pg_slug_gen_15-1.0.0-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 1.0.0 el10.x86_64.pg19 : pg_slug_gen_19 pg_slug_gen_19-1.0.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg18 : pg_slug_gen_18 pg_slug_gen_18-1.0.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg17 : pg_slug_gen_17 pg_slug_gen_17-1.0.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg16 : pg_slug_gen_16 pg_slug_gen_16-1.0.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg15 : pg_slug_gen_15 pg_slug_gen_15-1.0.0-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 1.0.0 el10.aarch64.pg19 : pg_slug_gen_19 pg_slug_gen_19-1.0.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg18 : pg_slug_gen_18 pg_slug_gen_18-1.0.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg17 : pg_slug_gen_17 pg_slug_gen_17-1.0.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg16 : pg_slug_gen_16 pg_slug_gen_16-1.0.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg15 : pg_slug_gen_15 pg_slug_gen_15-1.0.0-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.0.0 d12.x86_64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.0.0 d12.aarch64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.0.0 d13.x86_64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.0.0 d13.aarch64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.0.0 u22.x86_64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.0.0 u22.aarch64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.0.0 u24.x86_64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.0.0 u24.aarch64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 1.0.0 u26.x86_64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0.0 u26.x86_64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0.0 u26.x86_64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0.0 u26.x86_64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0.0 u26.x86_64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 1.0.0 u26.aarch64.pg19 : postgresql-19-pg-slug-gen postgresql-19-pg-slug-gen_1.0.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0.0 u26.aarch64.pg18 : postgresql-18-pg-slug-gen postgresql-18-pg-slug-gen_1.0.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0.0 u26.aarch64.pg17 : postgresql-17-pg-slug-gen postgresql-17-pg-slug-gen_1.0.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0.0 u26.aarch64.pg16 : postgresql-16-pg-slug-gen postgresql-16-pg-slug-gen_1.0.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0.0 u26.aarch64.pg15 : postgresql-15-pg-slug-gen postgresql-15-pg-slug-gen_1.0.0-1PGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for pg_slug_gen using pig build:
Install
You can install pg_slug_gen directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources: repo README, official PGXN release page, official release README, official release SQL, official release metadata
pg_slug_gen generates timestamp-based slugs with cryptographic randomness. The official 1.0.0 release describes it as a secure, URL-friendly short ID generator where the requested length selects the timestamp precision.
Function
gen_random_slug(slug_length int DEFAULT 16) returns text
The release SQL comment and README document these supported values:
10: seconds13: milliseconds16: microseconds, also the default19: nanoseconds
Precision And Format
Each precision maps to a timestamp width and a fixed slug shape:
10digits:5-5format, 11 characters total13digits:6-7format, 14 characters total16digits:8-8format, 17 characters total19digits:9-10format, 20 characters total
The README states the collision-free window is bounded by timestamp precision: at most 1 insert per second, millisecond, microsecond, or nanosecond respectively.
Examples
How It Works
The official README describes this algorithm:
- take the current timestamp at the chosen precision
- map each digit to a QWERTY-based character bucket
- choose one random character from that bucket with
pg_strong_random() - insert a hyphen at the midpoint
Caveats
- This is a secure short-ID generator, not a text transliteration or title-to-URL slugifier.
- Same-timestamp collisions are still possible; upstream only claims uniqueness when inserts do not exceed one per chosen time unit.
- The catalog URL is the current
https://github.com/nandoolle/pg_slug_genrepository; the PGXN release metadata still points to the olderfernandoolleGitHub URL. - The curated package matrix targets PostgreSQL 15 through 18, while PGXN metadata only declares a minimum PostgreSQL version. Use the catalog matrix for packaged availability.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)