跳转到主要内容

base36

Base36编码解码扩展

pg_base36 · Base36编码解码扩展

概览

ID扩展软件包版本类别许可证编程语言
4810base36pg_base361.1.1FUNCMITC
属性可执行文件动态库需要预加载需要建扩展可迁移可信
--s-d-r否是否是是否

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTPIGSTY1.1.119 18 17 16 15pg_base36-
RPMPIGSTY1.1.119 18 17 16 15pg_base36_$v-
DEBPIGSTY1.1.119 18 17 16 15postgresql-$v-base36-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
el8.aarch64N/APIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
el9.x86_64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
el9.aarch64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
el10.x86_64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
el10.aarch64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
d12.x86_64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
d12.aarch64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
d13.x86_64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
d13.aarch64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
u22.x86_64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
u22.aarch64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
u24.x86_64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
u24.aarch64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
u26.x86_64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
u26.aarch64PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1PIGSTY 1.1.1
软件包版本平台仓库大小下载
pg_base36_191.1.1el9.x86_64pigsty25.0 KiBpg_base36_19-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_191.1.1el9.aarch64pigsty25.0 KiBpg_base36_19-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_191.1.1el10.x86_64pigsty25.2 KiBpg_base36_19-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_191.1.1el10.aarch64pigsty25.3 KiBpg_base36_19-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-19-base361.1.1d12.x86_64pigsty16.3 KiBpostgresql-19-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-19-base361.1.1d12.aarch64pigsty16.3 KiBpostgresql-19-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-19-base361.1.1d13.x86_64pigsty16.4 KiBpostgresql-19-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-19-base361.1.1d13.aarch64pigsty16.4 KiBpostgresql-19-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-19-base361.1.1u22.x86_64pigsty16.6 KiBpostgresql-19-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-19-base361.1.1u22.aarch64pigsty16.4 KiBpostgresql-19-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-19-base361.1.1u24.x86_64pigsty17.0 KiBpostgresql-19-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-19-base361.1.1u24.aarch64pigsty17.1 KiBpostgresql-19-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-19-base361.1.1u26.x86_64pigsty16.9 KiBpostgresql-19-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-19-base361.1.1u26.aarch64pigsty17.1 KiBpostgresql-19-base36_1.1.1-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
pg_base36_181.1.1el8.x86_64pigsty25.2 KiBpg_base36_18-1.1.1-1PGSTY.el8.x86_64.rpm
pg_base36_181.1.1el8.aarch64pigsty25.2 KiBpg_base36_18-1.1.1-1PGSTY.el8.aarch64.rpm
pg_base36_181.1.1el9.x86_64pigsty25.0 KiBpg_base36_18-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_181.1.1el9.aarch64pigsty25.0 KiBpg_base36_18-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_181.1.1el10.x86_64pigsty25.2 KiBpg_base36_18-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_181.1.1el10.aarch64pigsty25.3 KiBpg_base36_18-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-18-base361.1.1d12.x86_64pigsty16.3 KiBpostgresql-18-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-18-base361.1.1d12.aarch64pigsty16.3 KiBpostgresql-18-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-18-base361.1.1d13.x86_64pigsty16.4 KiBpostgresql-18-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-18-base361.1.1d13.aarch64pigsty16.4 KiBpostgresql-18-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-18-base361.1.1u22.x86_64pigsty16.6 KiBpostgresql-18-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-18-base361.1.1u22.aarch64pigsty16.4 KiBpostgresql-18-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-18-base361.1.1u24.x86_64pigsty17.0 KiBpostgresql-18-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-18-base361.1.1u24.aarch64pigsty17.1 KiBpostgresql-18-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-18-base361.1.1u26.x86_64pigsty16.9 KiBpostgresql-18-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-18-base361.1.1u26.aarch64pigsty17.1 KiBpostgresql-18-base36_1.1.1-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
pg_base36_171.1.1el8.x86_64pigsty24.9 KiBpg_base36_17-1.1.1-1PGSTY.el8.x86_64.rpm
pg_base36_171.1.1el8.aarch64pigsty25.0 KiBpg_base36_17-1.1.1-1PGSTY.el8.aarch64.rpm
pg_base36_171.1.1el9.x86_64pigsty24.8 KiBpg_base36_17-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_171.1.1el9.aarch64pigsty24.8 KiBpg_base36_17-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_171.1.1el10.x86_64pigsty24.8 KiBpg_base36_17-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_171.1.1el10.aarch64pigsty25.1 KiBpg_base36_17-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-17-base361.1.1d12.x86_64pigsty15.9 KiBpostgresql-17-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-17-base361.1.1d12.aarch64pigsty16.1 KiBpostgresql-17-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-17-base361.1.1d13.x86_64pigsty16.0 KiBpostgresql-17-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-17-base361.1.1d13.aarch64pigsty16.2 KiBpostgresql-17-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-17-base361.1.1u22.x86_64pigsty16.8 KiBpostgresql-17-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-17-base361.1.1u22.aarch64pigsty16.6 KiBpostgresql-17-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-17-base361.1.1u24.x86_64pigsty16.6 KiBpostgresql-17-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-17-base361.1.1u24.aarch64pigsty16.8 KiBpostgresql-17-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-17-base361.1.1u26.x86_64pigsty16.5 KiBpostgresql-17-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-17-base361.1.1u26.aarch64pigsty16.9 KiBpostgresql-17-base36_1.1.1-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
pg_base36_161.1.1el8.x86_64pigsty24.9 KiBpg_base36_16-1.1.1-1PGSTY.el8.x86_64.rpm
pg_base36_161.1.1el8.aarch64pigsty25.0 KiBpg_base36_16-1.1.1-1PGSTY.el8.aarch64.rpm
pg_base36_161.1.1el9.x86_64pigsty24.9 KiBpg_base36_16-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_161.1.1el9.aarch64pigsty24.8 KiBpg_base36_16-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_161.1.1el10.x86_64pigsty24.9 KiBpg_base36_16-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_161.1.1el10.aarch64pigsty25.1 KiBpg_base36_16-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-16-base361.1.1d12.x86_64pigsty15.9 KiBpostgresql-16-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-16-base361.1.1d12.aarch64pigsty16.1 KiBpostgresql-16-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-16-base361.1.1d13.x86_64pigsty16.0 KiBpostgresql-16-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-16-base361.1.1d13.aarch64pigsty16.2 KiBpostgresql-16-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-16-base361.1.1u22.x86_64pigsty16.8 KiBpostgresql-16-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-16-base361.1.1u22.aarch64pigsty16.6 KiBpostgresql-16-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-16-base361.1.1u24.x86_64pigsty16.6 KiBpostgresql-16-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-16-base361.1.1u24.aarch64pigsty16.8 KiBpostgresql-16-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-16-base361.1.1u26.x86_64pigsty16.5 KiBpostgresql-16-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-16-base361.1.1u26.aarch64pigsty16.8 KiBpostgresql-16-base36_1.1.1-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
pg_base36_151.1.1el8.x86_64pigsty24.9 KiBpg_base36_15-1.1.1-1PGSTY.el8.x86_64.rpm
pg_base36_151.1.1el8.aarch64pigsty25.0 KiBpg_base36_15-1.1.1-1PGSTY.el8.aarch64.rpm
pg_base36_151.1.1el9.x86_64pigsty24.8 KiBpg_base36_15-1.1.1-1PGSTY.el9.x86_64.rpm
pg_base36_151.1.1el9.aarch64pigsty24.8 KiBpg_base36_15-1.1.1-1PGSTY.el9.aarch64.rpm
pg_base36_151.1.1el10.x86_64pigsty24.8 KiBpg_base36_15-1.1.1-1PGSTY.el10.x86_64.rpm
pg_base36_151.1.1el10.aarch64pigsty25.1 KiBpg_base36_15-1.1.1-1PGSTY.el10.aarch64.rpm
postgresql-15-base361.1.1d12.x86_64pigsty15.9 KiBpostgresql-15-base36_1.1.1-1PGSTY~bookworm_amd64.deb
postgresql-15-base361.1.1d12.aarch64pigsty16.1 KiBpostgresql-15-base36_1.1.1-1PGSTY~bookworm_arm64.deb
postgresql-15-base361.1.1d13.x86_64pigsty16.0 KiBpostgresql-15-base36_1.1.1-1PGSTY~trixie_amd64.deb
postgresql-15-base361.1.1d13.aarch64pigsty16.2 KiBpostgresql-15-base36_1.1.1-1PGSTY~trixie_arm64.deb
postgresql-15-base361.1.1u22.x86_64pigsty16.7 KiBpostgresql-15-base36_1.1.1-1PGSTY~jammy_amd64.deb
postgresql-15-base361.1.1u22.aarch64pigsty16.6 KiBpostgresql-15-base36_1.1.1-1PGSTY~jammy_arm64.deb
postgresql-15-base361.1.1u24.x86_64pigsty16.6 KiBpostgresql-15-base36_1.1.1-1PGSTY~noble_amd64.deb
postgresql-15-base361.1.1u24.aarch64pigsty16.8 KiBpostgresql-15-base36_1.1.1-1PGSTY~noble_arm64.deb
postgresql-15-base361.1.1u26.x86_64pigsty16.5 KiBpostgresql-15-base36_1.1.1-1PGSTY~resolute_amd64.deb
postgresql-15-base361.1.1u26.aarch64pigsty16.9 KiBpostgresql-15-base36_1.1.1-1PGSTY~resolute_arm64.deb

源码

pig build pkg pg_base36;		# build rpm/deb

安装

启用 PGDG 和 PIGSTY 仓库并更新缓存。

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

使用 pig 安装扩展。

pig install pg_base36;		# install by package name
pig install base36;		# install by extension name

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 EXTENSION base36;

用法

base36: PostgreSQL 的 base36 编解码数据类型

提供使用 base36 方案进行编码和解码的数据类型,支持 base36 与整数类型之间的转换。

CREATE EXTENSION base36;

类型

类型存储最大字符串长度最大数值
base364 字节(int)6 字符2,147,483,647
bigbase368 字节(bigint)13 字符9,223,372,036,854,775,807

示例

-- 将整数编码为 base36
SELECT 1234567::base36;          -- 'qglj'

-- 将 base36 解码为整数
SELECT 'qglj'::base36::int;     -- 1234567

-- 用于更大数值的 bigbase36
SELECT 9223372036854775807::bigbase36;           -- 'i1y004og0svr'
SELECT 'i1y004og0svr'::bigbase36::bigint;        -- 9223372036854775807

表格阅读器