url_encode
url_encode, url_decode functions
Repository
okbob/url_encode
https://github.com/okbob/url_encode
Source
url_encode-1.2.5.tar.gz
url_encode-1.2.5.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
url_encode | 1.2.5 | UTIL | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4190 | url_encode | No | Yes | No | Yes | No | Yes | - |
| Related | pg_html5_email_address base36 base62 gzip bzip zstd http pg_net |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.2.5 | 1817161514 | url_encode | - |
| RPM | PIGSTY | 1.2.5 | 1817161514 | url_encode_$v | - |
| DEB | PIGSTY | 1.2.5 | 1817161514 | postgresql-$v-url-encode | - |
Build
You can build the RPM / DEB packages for url_encode using pig build:
pig build pkg url_encode # build RPM / DEB packages
Install
You can install url_encode directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install url_encode; # Install for current active PG version
pig ext install -y url_encode -v 18 # PG 18
pig ext install -y url_encode -v 17 # PG 17
pig ext install -y url_encode -v 16 # PG 16
pig ext install -y url_encode -v 15 # PG 15
pig ext install -y url_encode -v 14 # PG 14
dnf install -y url_encode_18 # PG 18
dnf install -y url_encode_17 # PG 17
dnf install -y url_encode_16 # PG 16
dnf install -y url_encode_15 # PG 15
dnf install -y url_encode_14 # PG 14
apt install -y postgresql-18-url-encode # PG 18
apt install -y postgresql-17-url-encode # PG 17
apt install -y postgresql-16-url-encode # PG 16
apt install -y postgresql-15-url-encode # PG 15
apt install -y postgresql-14-url-encode # PG 14
Create Extension:
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
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.