pg_isok

基于查询的数据完整性管理与软告警扩展

概览

扩展包名版本分类许可证语言
pg_isok1.4.1UTILAGPL-3.0SQL
ID扩展名BinLibLoadCreateTrustReloc模式
4340pg_isok-

superuser=false, but this is not a trusted extension.

版本

类型仓库版本PG 大版本包名依赖
EXTPIGSTY1.4.11817161514pg_isok-
RPMPIGSTY1.4.11817161514pg_isok_$v-
DEBPIGSTY1.4.11817161514postgresql-$v-pg-isok-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u22.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u22.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u24.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u24.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1

构建

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

pig build pkg pg_isok         # 构建 RPM / DEB 包

安装

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

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

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

pig install pg_isok;          # 当前活跃 PG 版本安装
pig ext install -y pg_isok -v 18  # PG 18
pig ext install -y pg_isok -v 17  # PG 17
pig ext install -y pg_isok -v 16  # PG 16
pig ext install -y pg_isok -v 15  # PG 15
pig ext install -y pg_isok -v 14  # PG 14
dnf install -y pg_isok_18       # PG 18
dnf install -y pg_isok_17       # PG 17
dnf install -y pg_isok_16       # PG 16
dnf install -y pg_isok_15       # PG 15
dnf install -y pg_isok_14       # PG 14
apt install -y postgresql-18-pg-isok   # PG 18
apt install -y postgresql-17-pg-isok   # PG 17
apt install -y postgresql-16-pg-isok   # PG 16
apt install -y postgresql-15-pg-isok   # PG 15
apt install -y postgresql-14-pg-isok   # PG 14

创建扩展

CREATE EXTENSION pg_isok;

用法

  • 来源: Codeberg 仓库, 文档首页, 文档源文件
  • Isok 是面向 PostgreSQL 的查询中心型监控扩展。它关注的是相较于先前已见过的可疑数据模式的变化,而不仅仅是某些行是否存在。
CREATE SCHEMA isok;
CREATE EXTENSION pg_isok SCHEMA isok;

核心流程

该扩展围绕两张表展开:

  • ISOK_QUERIES 存储监控查询
  • ISOK_RESULTS 存储发现的问题及其处理状态

通过 run_isok_queries() 运行监控:

SELECT * FROM run_isok_queries();
SELECT * FROM run_isok_queries($$VALUES ('new_countries')$$) AS problems;

ISOK_RESULTS 中的行可以标记为已解决或延后,因此后续运行不再将其报告为活动问题。

备注

文档将 Isok 描述为一种“软触发器”风格的数据清理与完整性审查工具。它可在 PostgreSQL 10 及以上版本安装,并且在受管环境中可按纯 SQL 方式构建。


最后修改 2026-04-14: update extension catalog (fa7cf58)