pg_sats
Per-role query metering and optional enforcement using satoshi-denominated balances.
pg_sats · Per-role query metering and optional enforcement using satoshi-denominated balances.
Overview
PostgreSQL · 14, 15, 16, 17, 18
Usage
Sources:
pg_sats Per-role query metering and optional enforcement using satoshi-denominated balances.
Enablement
Merge pg_sats into the existing preload list, restart PostgreSQL, and then create pg_sats in each database that needs its SQL objects:
Core Workflow
The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.
Main Objects
The reviewed install surface includes these prominent objects:
| Object | Kind | Operational role |
|---|---|---|
pg_sats.balance | FUNCTION | Callable function from the reviewed install surface. |
pg_sats.deposit | FUNCTION | Callable function from the reviewed install surface. |
pg_sats.history | FUNCTION | Callable function from the reviewed install surface. |
pg_sats.balances | TABLE | Extension-owned table; account for its data in backup and upgrades. |
pg_sats.query_history | TABLE | Extension-owned table; account for its data in backup and upgrades. |
Operations and Boundaries
- The verified PostgreSQL-major evidence covers 14, 15, 16, 17, 18; do not infer unlisted majors.
- Preloading
pg_satschanges cluster startup state; stage configuration and restart changes separately fromCREATE EXTENSION. - The extension fixes or creates schema objects under
pg_sats; include them in privilege and backup review.