pg_living_assertions
pg_living_assertions : Executable SQL checks with verdict dates and assertion history
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 5300 | pg_living_assertions | pg_living_assertions | 0.5.1 |
ADMIN | PostgreSQL | SQL |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| ----d-- | No | No | No | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | living_assertions |
| Need By | pg_grammar_guard |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.5.1 |
18 17 16 15 14 | pg_living_assertions |
- |
| RPM | PIGSTY | 0.5.1 |
18 17 16 15 14 | pg_living_assertions_$v |
- |
| DEB | PIGSTY | 0.5.1 |
18 17 16 15 14 | postgresql-$v-pg-living-assertions |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| el8.aarch64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| el9.x86_64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| el9.aarch64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| el10.x86_64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| el10.aarch64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| d12.x86_64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| d12.aarch64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| d13.x86_64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| d13.aarch64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| u22.x86_64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| u22.aarch64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| u24.x86_64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| u24.aarch64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| u26.x86_64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
| u26.aarch64 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 | PIGSTY 0.5.1 |
Source
github.com/Manuelreyesbravo/pg_living_assertions
pg_living_assertions-0.5.1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
- 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 stores SQL checks, verdicts, verification times and replacement history. These are checks run on demand, not SQL ASSERTION constraints evaluated on every write. It is a pure SQL extension with no preload requirement.
Register and Verify
Results and History
A check must return exactly one row with boolean holds and optional text detail. living_assertions.run_all() evaluates registered checks. living_assertions.state() distinguishes holds, broken, unknown, erroring, unchecked, retired and unregistered; living_assertions.stale() separates never-checked assertions from old results. living_assertions.declare_unchanged() records an expression for later text comparison, so the author must canonicalize its output. Definitions are superseded with a reason; results and registry data are included in database dumps.
Execution and Privileges
Since 0.5.0 the evaluator runs read-only inside a subtransaction that is always rolled back, preserving its verdict. This repairs the older STABLE-only evaluator, which did not stop side effects through volatile functions. It is not a sandbox for untrusted SQL: temporary-sequence changes, session advisory locks and external effects can survive. Only trusted administrators should register checks; they execute with the privileges of the later caller. Registry tables belong to the extension owner and write functions are revoked from PUBLIC by default.
Upgrade
After installing the matching files, use ALTER EXTENSION pg_living_assertions UPDATE TO '0.5.1'. The 0.4.1→0.5.0→0.5.1 chain replaces evaluator functions without changing registry tables. The final patch qualifies row types in run() so type-cache invalidation does not resolve them under an assertion’s unrelated search path.
Fresh installation also uses an earlier base SQL script followed by the packaged upgrade chain; keep the complete set of matching scripts installed.