url_encode
url_encode
url_encode : url_encode, url_decode functions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4190 | url_encode | url_encode | 1.2.5 | UTIL | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pg_html5_email_address base36 base62 gzip bzip zstd http pg_net |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.2.5 | 18 17 16 15 14 | url_encode | - |
| RPM | PIGSTY | 1.2.5 | 18 17 16 15 14 | url_encode_$v | - |
| DEB | PIGSTY | 1.2.5 | 18 17 16 15 14 | postgresql-$v-url-encode | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
el8.aarch64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
el9.x86_64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
el9.aarch64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
el10.x86_64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
el10.aarch64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
d12.x86_64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
d12.aarch64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
d13.x86_64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
d13.aarch64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
u22.x86_64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
u22.aarch64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
u24.x86_64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
u24.aarch64 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 | PIGSTY 1.2.5 |
Source
pig build pkg url_encode; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install url_encode; # install via package name, for the active PG version
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
pig install url_encode -v 14; # install for PG 14Create 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%9Bteurl_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_Paulouri_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_PauloLast updated on