跳转到主要内容

omni_httpc

HTTP client

omnigres : HTTP client

Overview

ID Extension Package Version Category License Language
2950 omni_httpc omnigres 0.1.10 FEAT Apache-2.0 C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-- No Yes No Yes no no

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 0.1.10 18 17 16 15 14 omnigres omni_http, omni_types
RPM PIGSTY 20251108 18 17 16 15 14 omnigres_$v -
DEB PIGSTY 20251108 18 17 16 15 14 postgresql-$v-omnigres -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
el8.aarch64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
el9.x86_64 PIGSTY 20251108 PIGSTY 20250507 PIGSTY 20250507 PIGSTY 20250507 PIGSTY 20250507
el9.aarch64 PIGSTY 20251108 PIGSTY 20250507 PIGSTY 20250507 PIGSTY 20250507 PIGSTY 20250507
el10.x86_64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
el10.aarch64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
d12.x86_64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
d12.aarch64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
d13.x86_64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
d13.aarch64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
u22.x86_64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
u22.aarch64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
u24.x86_64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
u24.aarch64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
u26.x86_64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
u26.aarch64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108

Source

docs.omnigres.org/omni_httpc/reference/

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 via package name, for the active PG version
pig install omni_httpc;		# install by extension name, for the current active PG version

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
pig install omni_httpc -v 14;   # install for PG 14

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')
);
Option Type Default Description
http2_ratio smallint 0 0-100, percentage of HTTP/2 use
http3_ratio smallint 0 0-100, percentage of HTTP/3 use
force_cleartext_http2 bool false Use h2c
first_byte_timeout int 5000 Milliseconds
timeout int 5000 Milliseconds
follow_redirects bool true Follow HTTP redirects
cacerts text[] null PEM-encoded CA certificates
clientcert client_certificate null PEM-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