跳转到主要内容

omni_web

Omnigres Web工具箱

omnigres · Omnigres Web工具箱

概览

ID扩展软件包版本类别许可证编程语言
2976omni_webomnigres0.3.0FEATApache-2.0C
属性可执行文件动态库需要预加载需要建扩展可迁移可信
--s-d--否是否是否否

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTPIGSTY0.3.019 18 17 16 15omnigres-
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

源码

pig build pkg omnigres;		# build rpm/deb

安装

启用 PGDG 和 PIGSTY 仓库并更新缓存。

pig repo add pgsql -u   # add both repo and update cache

使用 pig 安装扩展。

pig install omnigres;		# install by package name
pig install omni_web;		# install by extension name

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

在数据库中创建扩展。

CREATE EXTENSION omni_web;

用法

omni_web: 通用 Web 栈原语

omni_web 扩展提供 Web 栈实用函数,通常与 omni_httpd 配合使用。

将 Cookie 头部解析为键值对:

SELECT * FROM omni_web.cookies('PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1');

返回包含 name 和 value 列的表。

查询字符串

omni_web.parse_query_string(text) – 将查询字符串解析为键值对数组:

SELECT omni_web.parse_query_string('key=value&a=1&a=2');

omni_web.param_get(parsed, key) – 获取参数的第一个值:

SELECT omni_web.param_get(omni_web.parse_query_string('a=1&a=2'), 'a');  -- '1'

omni_web.param_get_all(parsed, key) – 获取参数的所有值:

SELECT omni_web.param_get_all(omni_web.parse_query_string('a=1&a=2'), 'a');
-- 1
-- 2

表格阅读器