Skip to content

base62

Base62 extension for PostgreSQL

pg_base62 · Base62 extension for PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4820base62pg_base620.0.1FUNCMITC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.0.119 18 17 16 15pg_base62-
RPMPIGSTY0.0.119 18 17 16 15pg_base62_$v-
DEBPIGSTY0.0.119 18 17 16 15postgresql-$v-base62-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
el8.aarch64N/APIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
el9.x86_64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
el9.aarch64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
el10.x86_64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
el10.aarch64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
d12.x86_64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
d12.aarch64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
d13.x86_64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
d13.aarch64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
u22.x86_64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
u22.aarch64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
u24.x86_64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
u24.aarch64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
u26.x86_64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
u26.aarch64PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1PIGSTY 0.0.1
PackageVersionOSORGSIZEFile URL
pg_base62_190.0.1el9.x86_64pigsty34.5 KiBpg_base62_19-0.0.1-1PGSTY.el9.x86_64.rpm
pg_base62_190.0.1el9.aarch64pigsty34.6 KiBpg_base62_19-0.0.1-1PGSTY.el9.aarch64.rpm
pg_base62_190.0.1el10.x86_64pigsty35.0 KiBpg_base62_19-0.0.1-1PGSTY.el10.x86_64.rpm
pg_base62_190.0.1el10.aarch64pigsty34.8 KiBpg_base62_19-0.0.1-1PGSTY.el10.aarch64.rpm
postgresql-19-base620.0.1d12.x86_64pigsty25.5 KiBpostgresql-19-base62_0.0.1-1PGSTY~bookworm_amd64.deb
postgresql-19-base620.0.1d12.aarch64pigsty25.3 KiBpostgresql-19-base62_0.0.1-1PGSTY~bookworm_arm64.deb
postgresql-19-base620.0.1d13.x86_64pigsty25.9 KiBpostgresql-19-base62_0.0.1-1PGSTY~trixie_amd64.deb
postgresql-19-base620.0.1d13.aarch64pigsty25.8 KiBpostgresql-19-base62_0.0.1-1PGSTY~trixie_arm64.deb
postgresql-19-base620.0.1u22.x86_64pigsty26.7 KiBpostgresql-19-base62_0.0.1-1PGSTY~jammy_amd64.deb
postgresql-19-base620.0.1u22.aarch64pigsty26.8 KiBpostgresql-19-base62_0.0.1-1PGSTY~jammy_arm64.deb
postgresql-19-base620.0.1u24.x86_64pigsty27.1 KiBpostgresql-19-base62_0.0.1-1PGSTY~noble_amd64.deb
postgresql-19-base620.0.1u24.aarch64pigsty26.9 KiBpostgresql-19-base62_0.0.1-1PGSTY~noble_arm64.deb
postgresql-19-base620.0.1u26.x86_64pigsty27.2 KiBpostgresql-19-base62_0.0.1-1PGSTY~resolute_amd64.deb
postgresql-19-base620.0.1u26.aarch64pigsty27.1 KiBpostgresql-19-base62_0.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_base62_180.0.1el8.x86_64pigsty34.8 KiBpg_base62_18-0.0.1-1PGSTY.el8.x86_64.rpm
pg_base62_180.0.1el8.aarch64pigsty34.4 KiBpg_base62_18-0.0.1-1PGSTY.el8.aarch64.rpm
pg_base62_180.0.1el9.x86_64pigsty34.6 KiBpg_base62_18-0.0.1-1PGSTY.el9.x86_64.rpm
pg_base62_180.0.1el9.aarch64pigsty34.5 KiBpg_base62_18-0.0.1-1PGSTY.el9.aarch64.rpm
pg_base62_180.0.1el10.x86_64pigsty35.0 KiBpg_base62_18-0.0.1-1PGSTY.el10.x86_64.rpm
pg_base62_180.0.1el10.aarch64pigsty34.8 KiBpg_base62_18-0.0.1-1PGSTY.el10.aarch64.rpm
postgresql-18-base620.0.1d12.x86_64pigsty25.5 KiBpostgresql-18-base62_0.0.1-1PGSTY~bookworm_amd64.deb
postgresql-18-base620.0.1d12.aarch64pigsty25.3 KiBpostgresql-18-base62_0.0.1-1PGSTY~bookworm_arm64.deb
postgresql-18-base620.0.1d13.x86_64pigsty25.8 KiBpostgresql-18-base62_0.0.1-1PGSTY~trixie_amd64.deb
postgresql-18-base620.0.1d13.aarch64pigsty25.7 KiBpostgresql-18-base62_0.0.1-1PGSTY~trixie_arm64.deb
postgresql-18-base620.0.1u22.x86_64pigsty26.7 KiBpostgresql-18-base62_0.0.1-1PGSTY~jammy_amd64.deb
postgresql-18-base620.0.1u22.aarch64pigsty26.8 KiBpostgresql-18-base62_0.0.1-1PGSTY~jammy_arm64.deb
postgresql-18-base620.0.1u24.x86_64pigsty27.0 KiBpostgresql-18-base62_0.0.1-1PGSTY~noble_amd64.deb
postgresql-18-base620.0.1u24.aarch64pigsty26.9 KiBpostgresql-18-base62_0.0.1-1PGSTY~noble_arm64.deb
postgresql-18-base620.0.1u26.x86_64pigsty27.2 KiBpostgresql-18-base62_0.0.1-1PGSTY~resolute_amd64.deb
postgresql-18-base620.0.1u26.aarch64pigsty27.1 KiBpostgresql-18-base62_0.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_base62_170.0.1el8.x86_64pigsty34.8 KiBpg_base62_17-0.0.1-1PGSTY.el8.x86_64.rpm
pg_base62_170.0.1el8.aarch64pigsty34.4 KiBpg_base62_17-0.0.1-1PGSTY.el8.aarch64.rpm
pg_base62_170.0.1el9.x86_64pigsty34.6 KiBpg_base62_17-0.0.1-1PGSTY.el9.x86_64.rpm
pg_base62_170.0.1el9.aarch64pigsty34.5 KiBpg_base62_17-0.0.1-1PGSTY.el9.aarch64.rpm
pg_base62_170.0.1el10.x86_64pigsty35.0 KiBpg_base62_17-0.0.1-1PGSTY.el10.x86_64.rpm
pg_base62_170.0.1el10.aarch64pigsty34.7 KiBpg_base62_17-0.0.1-1PGSTY.el10.aarch64.rpm
postgresql-17-base620.0.1d12.x86_64pigsty25.5 KiBpostgresql-17-base62_0.0.1-1PGSTY~bookworm_amd64.deb
postgresql-17-base620.0.1d12.aarch64pigsty25.4 KiBpostgresql-17-base62_0.0.1-1PGSTY~bookworm_arm64.deb
postgresql-17-base620.0.1d13.x86_64pigsty25.8 KiBpostgresql-17-base62_0.0.1-1PGSTY~trixie_amd64.deb
postgresql-17-base620.0.1d13.aarch64pigsty25.6 KiBpostgresql-17-base62_0.0.1-1PGSTY~trixie_arm64.deb
postgresql-17-base620.0.1u22.x86_64pigsty27.2 KiBpostgresql-17-base62_0.0.1-1PGSTY~jammy_amd64.deb
postgresql-17-base620.0.1u22.aarch64pigsty27.2 KiBpostgresql-17-base62_0.0.1-1PGSTY~jammy_arm64.deb
postgresql-17-base620.0.1u24.x86_64pigsty27.1 KiBpostgresql-17-base62_0.0.1-1PGSTY~noble_amd64.deb
postgresql-17-base620.0.1u24.aarch64pigsty26.9 KiBpostgresql-17-base62_0.0.1-1PGSTY~noble_arm64.deb
postgresql-17-base620.0.1u26.x86_64pigsty27.2 KiBpostgresql-17-base62_0.0.1-1PGSTY~resolute_amd64.deb
postgresql-17-base620.0.1u26.aarch64pigsty27.0 KiBpostgresql-17-base62_0.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_base62_160.0.1el8.x86_64pigsty34.8 KiBpg_base62_16-0.0.1-1PGSTY.el8.x86_64.rpm
pg_base62_160.0.1el8.aarch64pigsty34.4 KiBpg_base62_16-0.0.1-1PGSTY.el8.aarch64.rpm
pg_base62_160.0.1el9.x86_64pigsty34.6 KiBpg_base62_16-0.0.1-1PGSTY.el9.x86_64.rpm
pg_base62_160.0.1el9.aarch64pigsty34.5 KiBpg_base62_16-0.0.1-1PGSTY.el9.aarch64.rpm
pg_base62_160.0.1el10.x86_64pigsty35.0 KiBpg_base62_16-0.0.1-1PGSTY.el10.x86_64.rpm
pg_base62_160.0.1el10.aarch64pigsty34.7 KiBpg_base62_16-0.0.1-1PGSTY.el10.aarch64.rpm
postgresql-16-base620.0.1d12.x86_64pigsty25.5 KiBpostgresql-16-base62_0.0.1-1PGSTY~bookworm_amd64.deb
postgresql-16-base620.0.1d12.aarch64pigsty25.4 KiBpostgresql-16-base62_0.0.1-1PGSTY~bookworm_arm64.deb
postgresql-16-base620.0.1d13.x86_64pigsty25.8 KiBpostgresql-16-base62_0.0.1-1PGSTY~trixie_amd64.deb
postgresql-16-base620.0.1d13.aarch64pigsty25.6 KiBpostgresql-16-base62_0.0.1-1PGSTY~trixie_arm64.deb
postgresql-16-base620.0.1u22.x86_64pigsty27.2 KiBpostgresql-16-base62_0.0.1-1PGSTY~jammy_amd64.deb
postgresql-16-base620.0.1u22.aarch64pigsty27.2 KiBpostgresql-16-base62_0.0.1-1PGSTY~jammy_arm64.deb
postgresql-16-base620.0.1u24.x86_64pigsty27.1 KiBpostgresql-16-base62_0.0.1-1PGSTY~noble_amd64.deb
postgresql-16-base620.0.1u24.aarch64pigsty26.9 KiBpostgresql-16-base62_0.0.1-1PGSTY~noble_arm64.deb
postgresql-16-base620.0.1u26.x86_64pigsty27.2 KiBpostgresql-16-base62_0.0.1-1PGSTY~resolute_amd64.deb
postgresql-16-base620.0.1u26.aarch64pigsty27.0 KiBpostgresql-16-base62_0.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_base62_150.0.1el8.x86_64pigsty34.8 KiBpg_base62_15-0.0.1-1PGSTY.el8.x86_64.rpm
pg_base62_150.0.1el8.aarch64pigsty34.4 KiBpg_base62_15-0.0.1-1PGSTY.el8.aarch64.rpm
pg_base62_150.0.1el9.x86_64pigsty34.6 KiBpg_base62_15-0.0.1-1PGSTY.el9.x86_64.rpm
pg_base62_150.0.1el9.aarch64pigsty34.5 KiBpg_base62_15-0.0.1-1PGSTY.el9.aarch64.rpm
pg_base62_150.0.1el10.x86_64pigsty35.0 KiBpg_base62_15-0.0.1-1PGSTY.el10.x86_64.rpm
pg_base62_150.0.1el10.aarch64pigsty34.7 KiBpg_base62_15-0.0.1-1PGSTY.el10.aarch64.rpm
postgresql-15-base620.0.1d12.x86_64pigsty25.6 KiBpostgresql-15-base62_0.0.1-1PGSTY~bookworm_amd64.deb
postgresql-15-base620.0.1d12.aarch64pigsty25.5 KiBpostgresql-15-base62_0.0.1-1PGSTY~bookworm_arm64.deb
postgresql-15-base620.0.1d13.x86_64pigsty26.0 KiBpostgresql-15-base62_0.0.1-1PGSTY~trixie_amd64.deb
postgresql-15-base620.0.1d13.aarch64pigsty25.8 KiBpostgresql-15-base62_0.0.1-1PGSTY~trixie_arm64.deb
postgresql-15-base620.0.1u22.x86_64pigsty27.2 KiBpostgresql-15-base62_0.0.1-1PGSTY~jammy_amd64.deb
postgresql-15-base620.0.1u22.aarch64pigsty27.2 KiBpostgresql-15-base62_0.0.1-1PGSTY~jammy_arm64.deb
postgresql-15-base620.0.1u24.x86_64pigsty27.2 KiBpostgresql-15-base62_0.0.1-1PGSTY~noble_amd64.deb
postgresql-15-base620.0.1u24.aarch64pigsty27.1 KiBpostgresql-15-base62_0.0.1-1PGSTY~noble_arm64.deb
postgresql-15-base620.0.1u26.x86_64pigsty27.3 KiBpostgresql-15-base62_0.0.1-1PGSTY~resolute_amd64.deb
postgresql-15-base620.0.1u26.aarch64pigsty27.2 KiBpostgresql-15-base62_0.0.1-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_base62;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install pg_base62;		# install by package name
pig install base62;		# install by extension name

pig install base62 -v 19;   # install for PG 19
pig install base62 -v 18;   # install for PG 18
pig install base62 -v 17;   # install for PG 17
pig install base62 -v 16;   # install for PG 16
pig install base62 -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION base62;

Usage

base62: base62 encoding/decoding data types for PostgreSQL

Provides data types for encoding and decoding values using the base62 scheme (0-9, A-Z, a-z).

CREATE EXTENSION base62;

Types

TypeStorageMax String LengthMax Numeric Value
base624 bytes (int)6 characters2,147,483,647
bigbase628 bytes (bigint)11 characters9,223,372,036,854,775,807
hugebase6216 bytes20 characters(bytea conversion)

Examples

-- Encode/decode base62
SELECT 2147483647::base62;          -- '2LKcb1'
SELECT '2LKcb1'::base62::int;      -- 2147483647

-- Bigbase62 for larger values
SELECT 9223372036854775807::bigbase62;           -- 'AzL8n0Y58m7'
SELECT 'AzL8n0Y58m7'::bigbase62::bigint;        -- 9223372036854775807

-- Hugebase62 with bytea conversion
SELECT 'AzL8n0Y58m7AzL8n0Y58'::hugebase62;
SELECT 'AzL8n0Y58m7AzL8n0Y58'::hugebase62::bytea;
SELECT '\x960c06065a6ed8ffff1e7149f40b1800'::bytea::hugebase62;

-- Note: base62 is case-sensitive
SELECT '2lkcb'::base62::int;   -- 40933305
SELECT '2LKCB'::base62::int;   -- 34635195

Table reader