Skip to content

url_encode

url_encode, url_decode functions

url_encode · url_encode, url_decode functions

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4200url_encodeurl_encode1.2.5UTILPostgreSQLC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
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
PackageVersionOSORGSIZEFile URL
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
PackageVersionOSORGSIZEFile URL
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
PackageVersionOSORGSIZEFile URL
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
PackageVersionOSORGSIZEFile URL
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
PackageVersionOSORGSIZEFile URL
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

Source

pig build pkg url_encode;		# 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 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 this extension with:

CREATE EXTENSION url_encode;

Usage

url_encode: URL encoding and decoding functions for PostgreSQL

Functions

url_encode(text) returns text

Percent-encode a string for use in URLs:

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

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

url_decode(text) returns text

Decode a percent-encoded string:

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

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

uri_encode(text) returns text

Encode a full URI (preserves scheme, slashes, etc.):

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

uri_decode(text) returns text

Decode an encoded URI:

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

Table reader