pg_wal_budget
PostgreSQL extension that observes and enforces WAL generation against configurable budgets by policy scope.
pg_wal_budget · PostgreSQL extension that observes and enforces WAL generation against configurable budgets by policy scope.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101645 | pg_wal_budget | pg_wal_budget | 0.3.0 | ADMIN | Apache-2.0 | Rust |
Usage
Sources:
- Official upstream README
- Official extension control file (pg_wal_budget.control)
- Official extension SQL (pg_wal_budget–0.2.1–0.3.0.sql)
pg_wal_budget — A Rust/pgrx PostgreSQL 17 extension that observes, predicts, and optionally enforces WAL-generation budgets by policy scope. Use it when administering or automating the database behavior described above. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
pwb.clear_tenant()is an extension function and returnsvoid.pwb.counters()is an extension function and returnstable.pwb.create_policy(scope_kind text, scope_value text, wal_rate_bytes_per_sec bigint, wal_burst_bytes bigint, mode text default 'observe', priority integer default 100)is an extension function and returnsinteger.pwb.disable_policy(policy_id integer)is an extension function and returnsvoid.pwb.flush_profiles()is an extension function and returnsvoid.pwb.policies()is an extension function and returnssetof.pwb.preload_status()is an extension function and returnstext.pwb.query_profiles()is an extension function and returnstable.pwb.recent_decisions(decision_limit integer default 100)is an extension function and returnstable.pwb.reset_profiles()is an extension function and returnsvoid.pwb.reset_stats()is an extension function and returnsvoid.pwb.scope_names()is an extension function and returnstable.pwb.scope_stats()is an extension function and returnstable.pwb.set_policy_mode(policy_id integer, mode text)is an extension function and returnsvoid.
Requirements and Caveats
- The reviewed control file declares default version
0.3.0. - The control file marks the extension as non-relocatable.
- The control file requires a superuser for installation.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.