跳转到主要内容

omni_yaml

Omnigres YAML工具包

omnigres · Omnigres YAML工具包

概览

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

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTPIGSTY0.1.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_yaml;		# install by extension name

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

在数据库中创建扩展。

CREATE EXTENSION omni_yaml;

用法

omni_yaml: YAML 工具箱

omni_yaml 扩展提供 YAML 与 JSON 之间的转换函数。

函数

omni_yaml.to_json(text) – 将 YAML 文本转换为 JSON:

SELECT omni_yaml.to_json('key: value');
-- 返回: {"key": "value"}

omni_yaml.to_yaml(json) – 将 JSON 转换为 YAML 文本:

SELECT omni_yaml.to_yaml('{"key": "value"}'::json);
-- 返回: key: value

JSONB 用法

不提供直接的 JSONB 支持。根据需要将 JSON 结果转换为 jsonb:

SELECT omni_yaml.to_json('key: value')::jsonb;

表格阅读器