base36

Integer Base36 types

Overview

PackageVersionCategoryLicenseLanguage
pg_base361.0.0FUNCMITC
IDExtensionBinLibLoadCreateTrustRelocSchema
4800base36NoYesNoYesNoNo-
Relatedbase62 pg_base58 pg_polyline uri pg_curl url_encode pg_rewrite sepgsql

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.0.01817161514pg_base36-
RPMPIGSTY1.0.01817161514pg_base36_$v-
DEBPIGSTY1.0.01817161514postgresql-$v-base36-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
u22.x86_64
u22.aarch64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
u24.x86_64
u24.aarch64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0

Build

You can build the RPM / DEB packages for pg_base36 using pig build:

pig build pkg pg_base36         # build RPM / DEB packages

Install

You can install pg_base36 directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pg_base36;          # Install for current active PG version
pig ext install -y pg_base36 -v 18  # PG 18
pig ext install -y pg_base36 -v 17  # PG 17
pig ext install -y pg_base36 -v 16  # PG 16
pig ext install -y pg_base36 -v 15  # PG 15
pig ext install -y pg_base36 -v 14  # PG 14
dnf install -y pg_base36_18       # PG 18
dnf install -y pg_base36_17       # PG 17
dnf install -y pg_base36_16       # PG 16
dnf install -y pg_base36_15       # PG 15
dnf install -y pg_base36_14       # PG 14
apt install -y postgresql-18-base36   # PG 18
apt install -y postgresql-17-base36   # PG 17
apt install -y postgresql-16-base36   # PG 16
apt install -y postgresql-15-base36   # PG 15
apt install -y postgresql-14-base36   # PG 14

Create Extension:

CREATE EXTENSION base36;

Usage

base36: base36 encoding/decoding data types for PostgreSQL

Provides data types for encoding and decoding values using the base36 scheme, with conversion between base36 and integer types.

CREATE EXTENSION base36;

Types

TypeStorageMax String LengthMax Numeric Value
base364 bytes (int)6 characters2,147,483,647
bigbase368 bytes (bigint)13 characters9,223,372,036,854,775,807

Examples

-- Encode integer to base36
SELECT 1234567::base36;          -- 'qglj'

-- Decode base36 to integer
SELECT 'qglj'::base36::int;     -- 1234567

-- Bigbase36 for larger values
SELECT 9223372036854775807::bigbase36;           -- 'i1y004og0svr'
SELECT 'i1y004og0svr'::bigbase36::bigint;        -- 9223372036854775807

Last Modified 2026-03-12: add pg extension catalog (95749bf)