pg_living_assertions
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
pg_living_assertions | 0.5.10 | ADMIN | Apache-2.0 | 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.10 | 1817161514 | pg_living_assertions | - |
| RPM | PIGSTY | 0.5.10 | 1817161514 | pg_living_assertions_$v | - |
| DEB | PIGSTY | 0.5.10 | 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 安装扩展:
创建扩展:
用法
来源:
pg_living_assertions 0.5.10 保存具名 SQL 断言、结果与替换历史。检查按需运行,并非每次写入都执行的约束。这是无需预加载的纯 SQL 扩展。
核心用法
运行边界
检查返回一个布尔列 holds 和可选文本列 detail。living_assertions.run_all() 执行注册表中的检查;living_assertions.state()、living_assertions.status 和 living_assertions.stale() 区分失效、未知、报错,以及过期或未执行的检查。living_assertions.declare_unchanged() 对规范化表达式计算指纹,原有值变成 NULL 时判为失效。检查以记录的作者身份,在只读且回滚的子事务中执行,采用作者搜索路径并将临时模式放在最后。调用者须有权 SET ROLE 到该作者。求值时取得的会话咨询锁会被释放,但外部副作用和临时序列变化不在沙箱控制范围内,只有可信作者应登记 SQL。注册和检查时间由服务器确定,表拒绝 TRUNCATE,退役与替换仅限作者或有权代理的角色。升级须安装完整匹配的 SQL 链;旧断言保留原有指纹算法。当前版本采用 Apache-2.0,截至 0.5.3 的已发布版本仍保留原来的 PostgreSQL License。
0.5.10 的角色隔离
0.5.10 在需要角色隔离时,将检查放入由记录作者拥有的临时 SECURITY DEFINER 函数。PostgreSQL 会拒绝在该执行环境中重置角色或会话授权;函数与只读检查在同一子事务中创建并回滚。需要该执行环境时,作者必须拥有数据库的 TEMP 权限,调用者仍须有权代理该作者。SECURITY DEFINER 调用者现可凭此权限执行其他作者的检查。这修复了 0.5.8/0.5.9 中重置角色的逃逸路径,但不会使外部副作用变得安全。
这个页面对您有帮助吗?
感谢反馈,我们会据此改进这篇文档。
哪里没有解决?(可选)