跳转到主要内容

url_encode

提供URL编码解码函数

url_encode · 提供URL编码解码函数

概览

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

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTPIGSTY1.2.519 18 17 16 15url_encode-
RPMPIGSTY1.2.519 18 17 16 15url_encode_$v-
DEBPIGSTY1.2.519 18 17 16 15postgresql-$v-url-encode-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
el8.aarch64N/APIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
el9.x86_64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
el9.aarch64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
el10.x86_64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
el10.aarch64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
d12.x86_64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
d12.aarch64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
d13.x86_64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
d13.aarch64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
u22.x86_64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
u22.aarch64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
u24.x86_64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
u24.aarch64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
u26.x86_64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
u26.aarch64PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5PIGSTY 1.2.5
软件包版本平台仓库大小下载
url_encode_191.2.5el9.x86_64pigsty21.6 KiBurl_encode_19-1.2.5-1PGSTY.el9.x86_64.rpm
url_encode_191.2.5el9.aarch64pigsty21.3 KiBurl_encode_19-1.2.5-1PGSTY.el9.aarch64.rpm
url_encode_191.2.5el10.x86_64pigsty21.5 KiBurl_encode_19-1.2.5-1PGSTY.el10.x86_64.rpm
url_encode_191.2.5el10.aarch64pigsty21.4 KiBurl_encode_19-1.2.5-1PGSTY.el10.aarch64.rpm
postgresql-19-url-encode1.2.5d12.x86_64pigsty12.8 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~bookworm_amd64.deb
postgresql-19-url-encode1.2.5d12.aarch64pigsty12.8 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~bookworm_arm64.deb
postgresql-19-url-encode1.2.5d13.x86_64pigsty12.8 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~trixie_amd64.deb
postgresql-19-url-encode1.2.5d13.aarch64pigsty12.9 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~trixie_arm64.deb
postgresql-19-url-encode1.2.5u22.x86_64pigsty13.1 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~jammy_amd64.deb
postgresql-19-url-encode1.2.5u22.aarch64pigsty12.9 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~jammy_arm64.deb
postgresql-19-url-encode1.2.5u24.x86_64pigsty13.2 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~noble_amd64.deb
postgresql-19-url-encode1.2.5u24.aarch64pigsty13.2 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~noble_arm64.deb
postgresql-19-url-encode1.2.5u26.x86_64pigsty13.2 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~resolute_amd64.deb
postgresql-19-url-encode1.2.5u26.aarch64pigsty13.2 KiBpostgresql-19-url-encode_1.2.5-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
url_encode_181.2.5el8.x86_64pigsty21.3 KiBurl_encode_18-1.2.5-1PGSTY.el8.x86_64.rpm
url_encode_181.2.5el8.aarch64pigsty21.1 KiBurl_encode_18-1.2.5-1PGSTY.el8.aarch64.rpm
url_encode_181.2.5el9.x86_64pigsty21.4 KiBurl_encode_18-1.2.5-1PGSTY.el9.x86_64.rpm
url_encode_181.2.5el9.aarch64pigsty21.2 KiBurl_encode_18-1.2.5-1PGSTY.el9.aarch64.rpm
url_encode_181.2.5el10.x86_64pigsty21.6 KiBurl_encode_18-1.2.5-1PGSTY.el10.x86_64.rpm
url_encode_181.2.5el10.aarch64pigsty21.6 KiBurl_encode_18-1.2.5-1PGSTY.el10.aarch64.rpm
postgresql-18-url-encode1.2.5d12.x86_64pigsty12.8 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~bookworm_amd64.deb
postgresql-18-url-encode1.2.5d12.aarch64pigsty12.9 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~bookworm_arm64.deb
postgresql-18-url-encode1.2.5d13.x86_64pigsty12.8 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~trixie_amd64.deb
postgresql-18-url-encode1.2.5d13.aarch64pigsty13.1 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~trixie_arm64.deb
postgresql-18-url-encode1.2.5u22.x86_64pigsty13.0 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~jammy_amd64.deb
postgresql-18-url-encode1.2.5u22.aarch64pigsty12.9 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~jammy_arm64.deb
postgresql-18-url-encode1.2.5u24.x86_64pigsty13.3 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~noble_amd64.deb
postgresql-18-url-encode1.2.5u24.aarch64pigsty13.3 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~noble_arm64.deb
postgresql-18-url-encode1.2.5u26.x86_64pigsty13.3 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~resolute_amd64.deb
postgresql-18-url-encode1.2.5u26.aarch64pigsty13.4 KiBpostgresql-18-url-encode_1.2.5-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
url_encode_171.2.5el8.x86_64pigsty21.3 KiBurl_encode_17-1.2.5-1PGSTY.el8.x86_64.rpm
url_encode_171.2.5el8.aarch64pigsty21.1 KiBurl_encode_17-1.2.5-1PGSTY.el8.aarch64.rpm
url_encode_171.2.5el9.x86_64pigsty21.4 KiBurl_encode_17-1.2.5-1PGSTY.el9.x86_64.rpm
url_encode_171.2.5el9.aarch64pigsty21.1 KiBurl_encode_17-1.2.5-1PGSTY.el9.aarch64.rpm
url_encode_171.2.5el10.x86_64pigsty21.6 KiBurl_encode_17-1.2.5-1PGSTY.el10.x86_64.rpm
url_encode_171.2.5el10.aarch64pigsty21.5 KiBurl_encode_17-1.2.5-1PGSTY.el10.aarch64.rpm
postgresql-17-url-encode1.2.5d12.x86_64pigsty12.8 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~bookworm_amd64.deb
postgresql-17-url-encode1.2.5d12.aarch64pigsty12.9 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~bookworm_arm64.deb
postgresql-17-url-encode1.2.5d13.x86_64pigsty12.8 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~trixie_amd64.deb
postgresql-17-url-encode1.2.5d13.aarch64pigsty13.1 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~trixie_arm64.deb
postgresql-17-url-encode1.2.5u22.x86_64pigsty13.2 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~jammy_amd64.deb
postgresql-17-url-encode1.2.5u22.aarch64pigsty13.0 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~jammy_arm64.deb
postgresql-17-url-encode1.2.5u24.x86_64pigsty13.2 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~noble_amd64.deb
postgresql-17-url-encode1.2.5u24.aarch64pigsty13.3 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~noble_arm64.deb
postgresql-17-url-encode1.2.5u26.x86_64pigsty13.3 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~resolute_amd64.deb
postgresql-17-url-encode1.2.5u26.aarch64pigsty13.3 KiBpostgresql-17-url-encode_1.2.5-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
url_encode_161.2.5el8.x86_64pigsty21.0 KiBurl_encode_16-1.2.5-1PGSTY.el8.x86_64.rpm
url_encode_161.2.5el8.aarch64pigsty20.9 KiBurl_encode_16-1.2.5-1PGSTY.el8.aarch64.rpm
url_encode_161.2.5el9.x86_64pigsty21.2 KiBurl_encode_16-1.2.5-1PGSTY.el9.x86_64.rpm
url_encode_161.2.5el9.aarch64pigsty20.9 KiBurl_encode_16-1.2.5-1PGSTY.el9.aarch64.rpm
url_encode_161.2.5el10.x86_64pigsty21.3 KiBurl_encode_16-1.2.5-1PGSTY.el10.x86_64.rpm
url_encode_161.2.5el10.aarch64pigsty21.3 KiBurl_encode_16-1.2.5-1PGSTY.el10.aarch64.rpm
postgresql-16-url-encode1.2.5d12.x86_64pigsty12.5 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~bookworm_amd64.deb
postgresql-16-url-encode1.2.5d12.aarch64pigsty12.6 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~bookworm_arm64.deb
postgresql-16-url-encode1.2.5d13.x86_64pigsty12.5 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~trixie_amd64.deb
postgresql-16-url-encode1.2.5d13.aarch64pigsty12.8 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~trixie_arm64.deb
postgresql-16-url-encode1.2.5u22.x86_64pigsty13.0 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~jammy_amd64.deb
postgresql-16-url-encode1.2.5u22.aarch64pigsty12.8 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~jammy_arm64.deb
postgresql-16-url-encode1.2.5u24.x86_64pigsty12.9 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~noble_amd64.deb
postgresql-16-url-encode1.2.5u24.aarch64pigsty13.0 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~noble_arm64.deb
postgresql-16-url-encode1.2.5u26.x86_64pigsty13.0 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~resolute_amd64.deb
postgresql-16-url-encode1.2.5u26.aarch64pigsty13.1 KiBpostgresql-16-url-encode_1.2.5-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
url_encode_151.2.5el8.x86_64pigsty21.1 KiBurl_encode_15-1.2.5-1PGSTY.el8.x86_64.rpm
url_encode_151.2.5el8.aarch64pigsty20.9 KiBurl_encode_15-1.2.5-1PGSTY.el8.aarch64.rpm
url_encode_151.2.5el9.x86_64pigsty21.2 KiBurl_encode_15-1.2.5-1PGSTY.el9.x86_64.rpm
url_encode_151.2.5el9.aarch64pigsty20.9 KiBurl_encode_15-1.2.5-1PGSTY.el9.aarch64.rpm
url_encode_151.2.5el10.x86_64pigsty21.4 KiBurl_encode_15-1.2.5-1PGSTY.el10.x86_64.rpm
url_encode_151.2.5el10.aarch64pigsty21.3 KiBurl_encode_15-1.2.5-1PGSTY.el10.aarch64.rpm
postgresql-15-url-encode1.2.5d12.x86_64pigsty12.5 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~bookworm_amd64.deb
postgresql-15-url-encode1.2.5d12.aarch64pigsty12.6 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~bookworm_arm64.deb
postgresql-15-url-encode1.2.5d13.x86_64pigsty12.5 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~trixie_amd64.deb
postgresql-15-url-encode1.2.5d13.aarch64pigsty12.8 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~trixie_arm64.deb
postgresql-15-url-encode1.2.5u22.x86_64pigsty13.0 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~jammy_amd64.deb
postgresql-15-url-encode1.2.5u22.aarch64pigsty12.8 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~jammy_arm64.deb
postgresql-15-url-encode1.2.5u24.x86_64pigsty13.0 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~noble_amd64.deb
postgresql-15-url-encode1.2.5u24.aarch64pigsty13.0 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~noble_arm64.deb
postgresql-15-url-encode1.2.5u26.x86_64pigsty13.1 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~resolute_amd64.deb
postgresql-15-url-encode1.2.5u26.aarch64pigsty13.1 KiBpostgresql-15-url-encode_1.2.5-1PGSTY~resolute_arm64.deb

源码

pig build pkg url_encode;		# build rpm/deb

安装

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

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

使用 pig 安装扩展。

pig install url_encode;		# install by package name

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

在数据库中创建扩展。

CREATE EXTENSION url_encode;

用法

url_encode: PostgreSQL 的 URL 编码与解码函数

函数

url_encode(text) returns text

对字符串进行百分号编码,用于 URL 中:

SELECT url_encode('Hello World');
-- Hello%20World

SELECT url_encode('Ahoj Svetе');
-- Ahoj%20Sv%C4%9Bte

url_decode(text) returns text

解码百分号编码的字符串:

SELECT url_decode('Hello%20World');
-- Hello World

SELECT url_decode('Ahoj%20Sv%C4%9Bte');
-- Ahoj Svetе

uri_encode(text) returns text

编码完整的 URI(保留协议、斜杠等):

SELECT uri_encode('http://hu.wikipedia.org/wiki/Sao_Paulo');
-- http://hu.wikipedia.org/wiki/S%C3%A3o_Paulo

uri_decode(text) returns text

解码已编码的 URI:

SELECT uri_decode('http://hu.wikipedia.org/wiki/S%C3%A3o_Paulo');
-- http://hu.wikipedia.org/wiki/Sao_Paulo

表格阅读器