跳转到主要内容

base36

Integer Base36 types

pg_base36 : Integer Base36 types

Overview

ID Extension Package Version Category License Language
4810 base36 pg_base36 1.1.1 FUNC MIT C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r No Yes No Yes yes no

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 1.1.1 19 18 17 16 15 pg_base36 -
RPM PIGSTY 1.1.1 19 18 17 16 15 pg_base36_$v -
DEB PIGSTY 1.1.1 19 18 17 16 15 postgresql-$v-base36 -
Linux / PG PG19 PG18 PG17 PG16 PG15
el8.x86_64 N/A PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
el8.aarch64 N/A PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
el9.x86_64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
el9.aarch64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
el10.x86_64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
el10.aarch64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
d12.x86_64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
d12.aarch64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
d13.x86_64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
d13.aarch64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
u22.x86_64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
u22.aarch64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
u24.x86_64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
u24.aarch64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
u26.x86_64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
u26.aarch64 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1 PIGSTY 1.1.1
Package Version OS ORG SIZE File URL
pg_base36_19 1.1.1 el9.x86_64 pigsty 25.0 KiB pg_base36_19-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_19 1.1.1 el9.aarch64 pigsty 25.0 KiB pg_base36_19-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_19 1.1.1 el10.x86_64 pigsty 25.2 KiB pg_base36_19-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_19 1.1.1 el10.aarch64 pigsty 25.3 KiB pg_base36_19-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-19-base36 1.1.1 d12.x86_64 pigsty 16.3 KiB postgresql-19-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-19-base36 1.1.1 d12.aarch64 pigsty 16.3 KiB postgresql-19-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-19-base36 1.1.1 d13.x86_64 pigsty 16.4 KiB postgresql-19-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-19-base36 1.1.1 d13.aarch64 pigsty 16.4 KiB postgresql-19-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-19-base36 1.1.1 u22.x86_64 pigsty 16.6 KiB postgresql-19-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-19-base36 1.1.1 u22.aarch64 pigsty 16.4 KiB postgresql-19-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-19-base36 1.1.1 u24.x86_64 pigsty 17.0 KiB postgresql-19-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-19-base36 1.1.1 u24.aarch64 pigsty 17.1 KiB postgresql-19-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-19-base36 1.1.1 u26.x86_64 pigsty 16.9 KiB postgresql-19-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-19-base36 1.1.1 u26.aarch64 pigsty 17.1 KiB postgresql-19-base36_1.1.1-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_base36_18 1.1.1 el8.x86_64 pigsty 25.2 KiB pg_base36_18-1.1.1-1PGSTY.el8.x86_64.rpm
pg_base36_18 1.1.1 el8.aarch64 pigsty 25.2 KiB pg_base36_18-1.1.1-1PGSTY.el8.aarch64.rpm
pg_base36_18 1.1.1 el9.x86_64 pigsty 24.9 KiB pg_base36_18-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_18 1.1.1 el9.aarch64 pigsty 25.0 KiB pg_base36_18-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_18 1.1.1 el10.x86_64 pigsty 25.2 KiB pg_base36_18-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_18 1.1.1 el10.aarch64 pigsty 25.3 KiB pg_base36_18-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-18-base36 1.1.1 d12.x86_64 pigsty 16.3 KiB postgresql-18-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-18-base36 1.1.1 d12.aarch64 pigsty 16.3 KiB postgresql-18-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-18-base36 1.1.1 d13.x86_64 pigsty 16.4 KiB postgresql-18-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-18-base36 1.1.1 d13.aarch64 pigsty 16.4 KiB postgresql-18-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-18-base36 1.1.1 u22.x86_64 pigsty 16.6 KiB postgresql-18-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-18-base36 1.1.1 u22.aarch64 pigsty 16.4 KiB postgresql-18-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-18-base36 1.1.1 u24.x86_64 pigsty 17.0 KiB postgresql-18-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-18-base36 1.1.1 u24.aarch64 pigsty 17.0 KiB postgresql-18-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-18-base36 1.1.1 u26.x86_64 pigsty 16.9 KiB postgresql-18-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-18-base36 1.1.1 u26.aarch64 pigsty 17.1 KiB postgresql-18-base36_1.1.1-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_base36_17 1.1.1 el8.x86_64 pigsty 24.9 KiB pg_base36_17-1.1.1-1PGSTY.el8.x86_64.rpm
pg_base36_17 1.1.1 el8.aarch64 pigsty 24.9 KiB pg_base36_17-1.1.1-1PGSTY.el8.aarch64.rpm
pg_base36_17 1.1.1 el9.x86_64 pigsty 24.7 KiB pg_base36_17-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_17 1.1.1 el9.aarch64 pigsty 24.8 KiB pg_base36_17-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_17 1.1.1 el10.x86_64 pigsty 24.8 KiB pg_base36_17-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_17 1.1.1 el10.aarch64 pigsty 25.1 KiB pg_base36_17-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-17-base36 1.1.1 d12.x86_64 pigsty 15.9 KiB postgresql-17-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-17-base36 1.1.1 d12.aarch64 pigsty 16.1 KiB postgresql-17-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-17-base36 1.1.1 d13.x86_64 pigsty 16.0 KiB postgresql-17-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-17-base36 1.1.1 d13.aarch64 pigsty 16.2 KiB postgresql-17-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-17-base36 1.1.1 u22.x86_64 pigsty 16.8 KiB postgresql-17-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-17-base36 1.1.1 u22.aarch64 pigsty 16.6 KiB postgresql-17-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-17-base36 1.1.1 u24.x86_64 pigsty 16.6 KiB postgresql-17-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-17-base36 1.1.1 u24.aarch64 pigsty 16.8 KiB postgresql-17-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-17-base36 1.1.1 u26.x86_64 pigsty 16.5 KiB postgresql-17-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-17-base36 1.1.1 u26.aarch64 pigsty 16.8 KiB postgresql-17-base36_1.1.1-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_base36_16 1.1.1 el8.x86_64 pigsty 24.9 KiB pg_base36_16-1.1.1-1PGSTY.el8.x86_64.rpm
pg_base36_16 1.1.1 el8.aarch64 pigsty 24.9 KiB pg_base36_16-1.1.1-1PGSTY.el8.aarch64.rpm
pg_base36_16 1.1.1 el9.x86_64 pigsty 24.6 KiB pg_base36_16-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_16 1.1.1 el9.aarch64 pigsty 24.7 KiB pg_base36_16-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_16 1.1.1 el10.x86_64 pigsty 24.8 KiB pg_base36_16-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_16 1.1.1 el10.aarch64 pigsty 25.0 KiB pg_base36_16-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-16-base36 1.1.1 d12.x86_64 pigsty 15.9 KiB postgresql-16-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-16-base36 1.1.1 d12.aarch64 pigsty 16.1 KiB postgresql-16-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-16-base36 1.1.1 d13.x86_64 pigsty 16.0 KiB postgresql-16-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-16-base36 1.1.1 d13.aarch64 pigsty 16.2 KiB postgresql-16-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-16-base36 1.1.1 u22.x86_64 pigsty 16.8 KiB postgresql-16-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-16-base36 1.1.1 u22.aarch64 pigsty 16.6 KiB postgresql-16-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-16-base36 1.1.1 u24.x86_64 pigsty 16.6 KiB postgresql-16-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-16-base36 1.1.1 u24.aarch64 pigsty 16.4 KiB postgresql-16-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-16-base36 1.1.1 u26.x86_64 pigsty 16.5 KiB postgresql-16-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-16-base36 1.1.1 u26.aarch64 pigsty 16.8 KiB postgresql-16-base36_1.1.1-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_base36_15 1.1.1 el8.x86_64 pigsty 24.9 KiB pg_base36_15-1.1.1-1PGSTY.el8.x86_64.rpm
pg_base36_15 1.1.1 el8.aarch64 pigsty 24.9 KiB pg_base36_15-1.1.1-1PGSTY.el8.aarch64.rpm
pg_base36_15 1.1.1 el9.x86_64 pigsty 24.7 KiB pg_base36_15-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_15 1.1.1 el9.aarch64 pigsty 24.7 KiB pg_base36_15-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_15 1.1.1 el10.x86_64 pigsty 24.8 KiB pg_base36_15-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_15 1.1.1 el10.aarch64 pigsty 25.0 KiB pg_base36_15-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-15-base36 1.1.1 d12.x86_64 pigsty 15.9 KiB postgresql-15-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-15-base36 1.1.1 d12.aarch64 pigsty 15.8 KiB postgresql-15-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-15-base36 1.1.1 d13.x86_64 pigsty 16.0 KiB postgresql-15-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-15-base36 1.1.1 d13.aarch64 pigsty 16.2 KiB postgresql-15-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-15-base36 1.1.1 u22.x86_64 pigsty 16.7 KiB postgresql-15-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-15-base36 1.1.1 u22.aarch64 pigsty 16.6 KiB postgresql-15-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-15-base36 1.1.1 u24.x86_64 pigsty 16.6 KiB postgresql-15-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-15-base36 1.1.1 u24.aarch64 pigsty 16.8 KiB postgresql-15-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-15-base36 1.1.1 u26.x86_64 pigsty 16.5 KiB postgresql-15-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-15-base36 1.1.1 u26.aarch64 pigsty 16.8 KiB postgresql-15-base36_1.1.1-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_base36;		# 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_base36;		# install via package name, for the active PG version
pig install base36;		# install by extension name, for the current active PG version

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

Create this extension with:

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

Type Storage Max String Length Max Numeric Value
base36 4 bytes (int) 6 characters 2,147,483,647
bigbase36 8 bytes (bigint) 13 characters 9,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

表格阅读器