uri
URI Data type for PostgreSQL
Repository
petere/pguri
https://github.com/petere/pguri
Source
pguri-1.20251029.tar.gz
pguri-1.20251029.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_uri | 1.20251029 | TYPE | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3790 | uri | No | Yes | No | Yes | No | Yes | - |
| Related | emailaddr pg_html5_email_address url_encode ip4r prefix asn1oid pg_smtp_client pg_utl_smtp omni_email isn |
|---|
+int flag
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.20251029 | 1817161514 | pg_uri | - |
| RPM | PIGSTY | 1.20251029 | 1817161514 | pguri_$v | - |
| DEB | PIGSTY | 1.20251029 | 1817161514 | postgresql-$v-pg-uri | - |
Build
You can build the RPM / DEB packages for pg_uri using pig build:
Install
You can install pg_uri directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
The uri extension provides a data type for storing URIs with syntax validation per RFC 3986, component extraction functions, and human-friendly sorting.
Component Extraction Functions
| Function | Returns | Description |
|---|---|---|
uri_scheme(uri) | text | Scheme (http, ftp, mailto) |
uri_userinfo(uri) | text | User info; NULL if absent |
uri_host(uri) | text | Hostname or IP address |
uri_host_inet(uri) | inet | IP host as inet; NULL if not IP |
uri_port(uri) | integer | Port number; NULL if unspecified |
uri_path(uri) | text | Path component (never NULL) |
uri_path_array(uri) | text[] | Path split by / |
uri_query(uri) | text | Query string; NULL if absent |
uri_fragment(uri) | text | Fragment; NULL if absent |
Utility Functions
Example
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)