omni_httpc

Omnigres HTTP客户端

概览

扩展包名版本分类许可证语言
omnigres0.1.10FEATApache-2.0C
ID扩展名BinLibLoadCreateTrustReloc模式
2940omniomni
2941omni_authomni_auth
2942omni_awsomni_aws
2943omni_cloudeventsomni_cloudevents
2944omni_containersomni_containers
2945omni_credentialsomni_credentials
2948omni_emailomni_email
2949omni_httpomni_http
2950omni_httpcomni_httpc
2951omni_httpdomni_httpd
2952omni_id-
2953omni_jsonomni_json
2954omni_kubeomni_kube
2955omni_ledgeromni_ledger
2956omni_manifestomni_manifest
2957omni_mimetypesomni_mimetypes
2958omni_osomni_os
2959omni_polyfillomni_polyfill
2960omni_pythonomni_python
2961omni_regex-
2962omni_restomni_rest
2963omni_schemaomni_schema
2964omni_seqomni_seq
2965omni_serviceomni_service
2966omni_sessionomni_session
2968omni_sqlomni_sql
2969omni_sqliteomni_sqlite
2970omni_testomni_test
2971omni_txnomni_txn
2972omni_typesomni_types
2973omni_varomni_var
2974omni_vfsomni_vfs
2975omni_vfs_types_v1omni_vfs_types_v1
2976omni_webomni_web
2977omni_workeromni_worker
2978omni_xmlomni_xml
2979omni_yamlomni_yaml
相关扩展omni_http omni_types
下游依赖omni_aws omni_containers omni_kube

版本

类型仓库版本PG 大版本包名依赖
EXTPIGSTY0.1.101817161514omnigresomni_http, omni_types
RPMPIGSTY0.1.101817161514omnigres_$v-
DEBPIGSTY0.1.101817161514postgresql-$v-omnigres-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64PIGSTY MISSPIGSTY 20250120PIGSTY 20250120PIGSTY 20250120PIGSTY 20250120
el8.aarch64PIGSTY MISSPIGSTY 20250120PIGSTY 20250120PIGSTY 20250120PIGSTY 20250120
el9.x86_64PIGSTY MISSPIGSTY 20250507PIGSTY 20250507PIGSTY 20250507PIGSTY 20250507
el9.aarch64PIGSTY MISSPIGSTY 20250507PIGSTY 20250507PIGSTY 20250507PIGSTY 20250507
el10.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
el10.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
d12.x86_64PIGSTY MISSPIGSTY 20250120PIGSTY 20250120PIGSTY 20250120PIGSTY 20250120
d12.aarch64PIGSTY MISSPIGSTY 20250120PIGSTY 20250120PIGSTY 20250120PIGSTY 20250120
d13.x86_64PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108
d13.aarch64PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108
u22.x86_64PIGSTY MISSPIGSTY 20250120PIGSTY 20250120PIGSTY 20250120PIGSTY 20250120
u22.aarch64PIGSTY MISSPIGSTY 20250120PIGSTY 20250120PIGSTY 20250120PIGSTY 20250120
u24.x86_64PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108
u24.aarch64PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108PIGSTY 20251108

构建

您可以使用 pig build 命令构建 omnigres 扩展的 RPM / DEB 包:

pig build pkg omnigres         # 构建 RPM / DEB 包

安装

您可以直接安装 omnigres 扩展包的预置二进制包,首先确保 PGDGPIGSTY 仓库已经添加并启用:

pig repo add pgsql -u          # 添加仓库并更新缓存

使用 pig 或者是 apt/yum/dnf 安装扩展:

pig install omnigres;          # 当前活跃 PG 版本安装
pig ext install -y omnigres -v 18  # PG 18
pig ext install -y omnigres -v 17  # PG 17
pig ext install -y omnigres -v 16  # PG 16
pig ext install -y omnigres -v 15  # PG 15
pig ext install -y omnigres -v 14  # PG 14
dnf install -y omnigres_18       # PG 18
dnf install -y omnigres_17       # PG 17
dnf install -y omnigres_16       # PG 16
dnf install -y omnigres_15       # PG 15
dnf install -y omnigres_14       # PG 14
apt install -y postgresql-18-omnigres   # PG 18
apt install -y postgresql-17-omnigres   # PG 17
apt install -y postgresql-16-omnigres   # PG 16
apt install -y postgresql-15-omnigres   # PG 15
apt install -y postgresql-14-omnigres   # PG 14

创建扩展

CREATE EXTENSION omni_httpc CASCADE;  -- 依赖: omni_http, omni_types

用法

omni_httpc: HTTP 客户端

omni_httpc 扩展提供 HTTP/1、HTTP/2 和 HTTP/3(实验性)客户端功能。

准备和执行请求

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) – 准备请求。方法默认为 GET。

http_execute(VARIADIC requests) – 执行一个或多个请求。返回 versionstatusheadersbodyerror 列。

执行选项

SELECT * FROM omni_httpc.http_execute_with_options(
    omni_httpc.http_execute_options(http2_ratio => 100),
    omni_httpc.http_request('https://example.com')
);
选项类型默认值描述
http2_ratiosmallint00-100,HTTP/2 使用百分比
http3_ratiosmallint00-100,HTTP/3 使用百分比
force_cleartext_http2boolfalse使用 h2c
first_byte_timeoutint5000毫秒
timeoutint5000毫秒
follow_redirectsbooltrue跟随 HTTP 重定向
cacertstext[]nullPEM 编码的 CA 证书
clientcertclient_certificatenullPEM 编码的客户端证书

http2_ratiohttp3_ratio 之和不得超过 100。

连接池

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

最后修改 2026-03-14: update extension metadata (953cbd0)