Skip to content

omni_httpc

HTTP client

omnigres · HTTP client

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2950omni_httpcomnigres0.1.11FEATApache-2.0C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d--NoYesNoYesnono

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.1.1119 18 17 16 15omnigresomni_http, omni_types
RPMPIGSTY2026021219 18 17 16 15omnigres_$vpostgresql$v-contrib, postgresql$v-plpython3, python3-pip
DEBPIGSTY2026021219 18 17 16 15postgresql-$v-omnigrespostgresql-plpython3-$v, python3-pip
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el8.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el9.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el9.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el10.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el10.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d12.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d12.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d13.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d13.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u22.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u22.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u24.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u24.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u26.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u26.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212

Source

pig build pkg omnigres;		# 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 omnigres;		# install by package name
pig install omni_httpc;		# install by extension name

pig install omni_httpc -v 18;   # install for PG 18
pig install omni_httpc -v 17;   # install for PG 17
pig install omni_httpc -v 16;   # install for PG 16
pig install omni_httpc -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION omni_httpc CASCADE; -- requires omni_http, omni_types

Usage

omni_httpc: HTTP client

The omni_httpc extension provides HTTP/1, HTTP/2, and HTTP/3 (experimental) client functionality.

Prepare and Execute Requests

SELECT version >> 8 AS http_version, status, headers, convert_from(body, 'utf-8')
FROM omni_httpc.http_execute(
    omni_httpc.http_request('https://example.com'),
    omni_httpc.http_request('https://example.org')
);

http_request(url, method, headers, body) – Prepares a request. Method defaults to GET.

http_execute(VARIADIC requests) – Executes one or more requests. Returns version, status, headers, body, and error columns.

Execution Options

SELECT * FROM omni_httpc.http_execute_with_options(
    omni_httpc.http_execute_options(http2_ratio => 100),
    omni_httpc.http_request('https://example.com')
);
OptionTypeDefaultDescription
http2_ratiosmallint00-100, percentage of HTTP/2 use
http3_ratiosmallint00-100, percentage of HTTP/3 use
force_cleartext_http2boolfalseUse h2c
first_byte_timeoutint5000Milliseconds
timeoutint5000Milliseconds
follow_redirectsbooltrueFollow HTTP redirects
cacertstext[]nullPEM-encoded CA certificates
clientcertclient_certificatenullPEM-encoded client cert

The sum of http2_ratio and http3_ratio must not exceed 100.

Connection Pool

SELECT * FROM omni_httpc.http_connections;
-- Returns: http_protocol, url

Table reader