Skip to content


URI Parsing

omni_web provides API for parsing URIs (omni_web.text_to_uri) that is also available through by casting text to omni_web.uri.

           select *

results in

Column Value
scheme http
user_info foo:bar
path path/to/page
port 8080
query query
fragment frag

URL/URI Encoding

Functionality for URL encoding

String encoding for a URL

To encode a string to be safely included as part of a URL:

select omni_web.url_encode('Hello World')

You will get Hello%20World

To decode and get back to the original string:

select omni_web.url_encode('Hello%20World')

Encoding a URI

Similar to JavaScript's encodeUri/decodeUri, you can also encode/decode a URI without encoding the "unreserved marks":

select omni_web.uri_encode('ão_Paulo')

The above results in

A counterpart function to that is uri_decode.