pg_living_assertions
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
pg_living_assertions | 0.5.1 | ADMIN | PostgreSQL | SQL |
| ID | 扩展名 | Bin | Lib | Load | Create | Trust | Reloc | 模式 |
|---|---|---|---|---|---|---|---|---|
| 5300 | pg_living_assertions | 否 | 否 | 否 | 是 | 否 | 否 | living_assertions |
| 相关扩展 | |
|---|---|
| 下游依赖 | pg_grammar_guard |
On-demand SQL checks run in a read-only subtransaction that is always rolled back; not per-write SQL ASSERTION constraints.
版本
| 类型 | 仓库 | 版本 | PG 大版本 | 包名 | 依赖 |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.5.1 | 1817161514 | pg_living_assertions | - |
| RPM | PIGSTY | 0.5.1 | 1817161514 | pg_living_assertions_$v | - |
| DEB | PIGSTY | 0.5.1 | 1817161514 | postgresql-$v-pg-living-assertions | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.5.1 el8.x86_64.pg18 : pg_living_assertions_18 pg_living_assertions_18-0.5.1-1PGSTY.el8.noarch.rpm
| PIGSTY 0.5.1 el8.x86_64.pg17 : pg_living_assertions_17 pg_living_assertions_17-0.5.1-1PGSTY.el8.noarch.rpm
| PIGSTY 0.5.1 el8.x86_64.pg16 : pg_living_assertions_16 pg_living_assertions_16-0.5.1-1PGSTY.el8.noarch.rpm
| PIGSTY 0.5.1 el8.x86_64.pg15 : pg_living_assertions_15 pg_living_assertions_15-0.5.1-1PGSTY.el8.noarch.rpm
| PIGSTY 0.5.1 el8.x86_64.pg14 : pg_living_assertions_14 pg_living_assertions_14-0.5.1-1PGSTY.el8.noarch.rpm
|
| el8.aarch64 | PIGSTY 0.5.1 el8.aarch64.pg18 : pg_living_assertions_18 pg_living_assertions_18-0.5.1-1PGSTY.el8.noarch.rpm
| PIGSTY 0.5.1 el8.aarch64.pg17 : pg_living_assertions_17 pg_living_assertions_17-0.5.1-1PGSTY.el8.noarch.rpm
| PIGSTY 0.5.1 el8.aarch64.pg16 : pg_living_assertions_16 pg_living_assertions_16-0.5.1-1PGSTY.el8.noarch.rpm
| PIGSTY 0.5.1 el8.aarch64.pg15 : pg_living_assertions_15 pg_living_assertions_15-0.5.1-1PGSTY.el8.noarch.rpm
| PIGSTY 0.5.1 el8.aarch64.pg14 : pg_living_assertions_14 pg_living_assertions_14-0.5.1-1PGSTY.el8.noarch.rpm
|
| el9.x86_64 | PIGSTY 0.5.1 el9.x86_64.pg18 : pg_living_assertions_18 pg_living_assertions_18-0.5.1-1PGSTY.el9.noarch.rpm
| PIGSTY 0.5.1 el9.x86_64.pg17 : pg_living_assertions_17 pg_living_assertions_17-0.5.1-1PGSTY.el9.noarch.rpm
| PIGSTY 0.5.1 el9.x86_64.pg16 : pg_living_assertions_16 pg_living_assertions_16-0.5.1-1PGSTY.el9.noarch.rpm
| PIGSTY 0.5.1 el9.x86_64.pg15 : pg_living_assertions_15 pg_living_assertions_15-0.5.1-1PGSTY.el9.noarch.rpm
| PIGSTY 0.5.1 el9.x86_64.pg14 : pg_living_assertions_14 pg_living_assertions_14-0.5.1-1PGSTY.el9.noarch.rpm
|
| el9.aarch64 | PIGSTY 0.5.1 el9.aarch64.pg18 : pg_living_assertions_18 pg_living_assertions_18-0.5.1-1PGSTY.el9.noarch.rpm
| PIGSTY 0.5.1 el9.aarch64.pg17 : pg_living_assertions_17 pg_living_assertions_17-0.5.1-1PGSTY.el9.noarch.rpm
| PIGSTY 0.5.1 el9.aarch64.pg16 : pg_living_assertions_16 pg_living_assertions_16-0.5.1-1PGSTY.el9.noarch.rpm
| PIGSTY 0.5.1 el9.aarch64.pg15 : pg_living_assertions_15 pg_living_assertions_15-0.5.1-1PGSTY.el9.noarch.rpm
| PIGSTY 0.5.1 el9.aarch64.pg14 : pg_living_assertions_14 pg_living_assertions_14-0.5.1-1PGSTY.el9.noarch.rpm
|
| el10.x86_64 | PIGSTY 0.5.1 el10.x86_64.pg18 : pg_living_assertions_18 pg_living_assertions_18-0.5.1-1PGSTY.el10.noarch.rpm
| PIGSTY 0.5.1 el10.x86_64.pg17 : pg_living_assertions_17 pg_living_assertions_17-0.5.1-1PGSTY.el10.noarch.rpm
| PIGSTY 0.5.1 el10.x86_64.pg16 : pg_living_assertions_16 pg_living_assertions_16-0.5.1-1PGSTY.el10.noarch.rpm
| PIGSTY 0.5.1 el10.x86_64.pg15 : pg_living_assertions_15 pg_living_assertions_15-0.5.1-1PGSTY.el10.noarch.rpm
| PIGSTY 0.5.1 el10.x86_64.pg14 : pg_living_assertions_14 pg_living_assertions_14-0.5.1-1PGSTY.el10.noarch.rpm
|
| el10.aarch64 | PIGSTY 0.5.1 el10.aarch64.pg18 : pg_living_assertions_18 pg_living_assertions_18-0.5.1-1PGSTY.el10.noarch.rpm
| PIGSTY 0.5.1 el10.aarch64.pg17 : pg_living_assertions_17 pg_living_assertions_17-0.5.1-1PGSTY.el10.noarch.rpm
| PIGSTY 0.5.1 el10.aarch64.pg16 : pg_living_assertions_16 pg_living_assertions_16-0.5.1-1PGSTY.el10.noarch.rpm
| PIGSTY 0.5.1 el10.aarch64.pg15 : pg_living_assertions_15 pg_living_assertions_15-0.5.1-1PGSTY.el10.noarch.rpm
| PIGSTY 0.5.1 el10.aarch64.pg14 : pg_living_assertions_14 pg_living_assertions_14-0.5.1-1PGSTY.el10.noarch.rpm
|
| d12.x86_64 | PIGSTY 0.5.1 d12.x86_64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
| PIGSTY 0.5.1 d12.x86_64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
| PIGSTY 0.5.1 d12.x86_64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
| PIGSTY 0.5.1 d12.x86_64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
| PIGSTY 0.5.1 d12.x86_64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
|
| d12.aarch64 | PIGSTY 0.5.1 d12.aarch64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
| PIGSTY 0.5.1 d12.aarch64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
| PIGSTY 0.5.1 d12.aarch64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
| PIGSTY 0.5.1 d12.aarch64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
| PIGSTY 0.5.1 d12.aarch64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~bookworm_all.deb
|
| d13.x86_64 | PIGSTY 0.5.1 d13.x86_64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
| PIGSTY 0.5.1 d13.x86_64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
| PIGSTY 0.5.1 d13.x86_64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
| PIGSTY 0.5.1 d13.x86_64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
| PIGSTY 0.5.1 d13.x86_64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
|
| d13.aarch64 | PIGSTY 0.5.1 d13.aarch64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
| PIGSTY 0.5.1 d13.aarch64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
| PIGSTY 0.5.1 d13.aarch64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
| PIGSTY 0.5.1 d13.aarch64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
| PIGSTY 0.5.1 d13.aarch64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~trixie_all.deb
|
| u22.x86_64 | PIGSTY 0.5.1 u22.x86_64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
| PIGSTY 0.5.1 u22.x86_64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
| PIGSTY 0.5.1 u22.x86_64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
| PIGSTY 0.5.1 u22.x86_64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
| PIGSTY 0.5.1 u22.x86_64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
|
| u22.aarch64 | PIGSTY 0.5.1 u22.aarch64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
| PIGSTY 0.5.1 u22.aarch64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
| PIGSTY 0.5.1 u22.aarch64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
| PIGSTY 0.5.1 u22.aarch64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
| PIGSTY 0.5.1 u22.aarch64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~jammy_all.deb
|
| u24.x86_64 | PIGSTY 0.5.1 u24.x86_64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
| PIGSTY 0.5.1 u24.x86_64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
| PIGSTY 0.5.1 u24.x86_64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
| PIGSTY 0.5.1 u24.x86_64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
| PIGSTY 0.5.1 u24.x86_64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
|
| u24.aarch64 | PIGSTY 0.5.1 u24.aarch64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
| PIGSTY 0.5.1 u24.aarch64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
| PIGSTY 0.5.1 u24.aarch64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
| PIGSTY 0.5.1 u24.aarch64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
| PIGSTY 0.5.1 u24.aarch64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~noble_all.deb
|
| u26.x86_64 | PIGSTY 0.5.1 u26.x86_64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
| PIGSTY 0.5.1 u26.x86_64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
| PIGSTY 0.5.1 u26.x86_64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
| PIGSTY 0.5.1 u26.x86_64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
| PIGSTY 0.5.1 u26.x86_64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
|
| u26.aarch64 | PIGSTY 0.5.1 u26.aarch64.pg18 : postgresql-18-pg-living-assertions postgresql-18-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
| PIGSTY 0.5.1 u26.aarch64.pg17 : postgresql-17-pg-living-assertions postgresql-17-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
| PIGSTY 0.5.1 u26.aarch64.pg16 : postgresql-16-pg-living-assertions postgresql-16-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
| PIGSTY 0.5.1 u26.aarch64.pg15 : postgresql-15-pg-living-assertions postgresql-15-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
| PIGSTY 0.5.1 u26.aarch64.pg14 : postgresql-14-pg-living-assertions postgresql-14-pg-living-assertions_0.5.1-1PGSTY~resolute_all.deb
|
构建
您可以使用 pig build 命令构建 pg_living_assertions 扩展的 RPM / DEB 包:
安装
您可以直接安装 pg_living_assertions 扩展包的预置二进制包,首先确保 PGDG 和 PIGSTY 仓库已经添加并启用:
使用 pig 或者是 apt/yum/dnf 安装扩展:
创建扩展:
用法
来源:
- README.md
- pg_living_assertions.control
- pg_living_assertions–0.4.1–0.5.0.sql
- pg_living_assertions–0.5.0–0.5.1.sql
- test/sql/read_only.sql
pg_living_assertions 0.5.1 保存 SQL 检查、结论、核验时间与替换历史。检查按需运行,并非每次写入都求值的 SQL ASSERTION 约束。此扩展为纯 SQL 实现,无需预加载。
注册与核验
结果与历史
每个检查必须返回恰好一行,包含布尔列 holds 和可选文本列 detail。living_assertions.run_all() 执行已注册检查。living_assertions.state() 区分成立、失效、未知、报错、未检查、已退役与未注册;living_assertions.stale() 区分从未检查与结果过期。living_assertions.declare_unchanged() 保存表达式以供后续文本比较,因此作者必须自行规范化输出。定义通过附带原因的替换保留历史,结果与注册表数据包含在数据库备份中。
执行与权限
从 0.5.0 起,求值器以只读方式在始终回滚的子事务中执行,并保留检查结论。这修复了旧求值器仅依赖 STABLE、无法阻止易变函数副作用的问题。它不是不可信 SQL 的沙箱:临时序列变更、会话级咨询锁与外部副作用仍可能保留。仅应授权可信管理员注册检查;检查使用后续调用者的权限执行。注册表属于扩展所有者,写入函数默认撤销 PUBLIC 执行权限。
升级
安装匹配的文件后,执行 ALTER EXTENSION pg_living_assertions UPDATE TO '0.5.1'。0.4.1→0.5.0→0.5.1 升级链替换求值函数,不修改注册表结构。最后的补丁在 run() 中限定行类型名称,防止类型缓存失效后在断言自身的无关搜索路径中重新解析类型。
全新安装也使用较早的基础 SQL 脚本并依次应用包内升级链,因此必须安装完整且版本匹配的脚本集。
这个页面对您有帮助吗?
感谢反馈,我们会据此改进这篇文档。
哪里没有解决?(可选)