pg_improv
pg_improv : Incremental multidimensional models and formula functions over PostgreSQL tables.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2580 | pg_improv | pg_improv | 0.13.0 |
OLAP | Apache-2.0 OR MIT | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | improv |
Packages
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | N/A |
| el8.aarch64 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | N/A |
| el9.x86_64 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | N/A |
| el9.aarch64 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | N/A |
| el10.x86_64 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | N/A |
| el10.aarch64 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | PIGSTY 0.13.0 | N/A |
| d12.x86_64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| d12.aarch64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| d13.x86_64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| d13.aarch64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| u22.x86_64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| u22.aarch64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| u24.x86_64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| u24.aarch64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| u26.x86_64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
| u26.aarch64 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | PIGSTY 0.12.2 | N/A |
Source
codeberg.org/gregburd/improv
improv-0.13.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
pg_improv 0.13.0 binds PostgreSQL tables to multidimensional models, evaluates formulas and materializes results. It supports PostgreSQL 15–18 and requires superuser installation. This example uses manual synchronization, which works without preloading the library.
Core Workflow
Bind categories before their measures. Duplicate coordinates require an explicit aggregate; null values do not create model cells. Result tables live in a model-specific schema. improv.define accepts replace => true to replace a formula, and improv.recalc returns the number of changed result rows.
Synchronization Modes
improv.set_sync_mode chooses manual, trigger, commit or logical synchronization. Trigger mode works without preloading; commit mode needs session or server preloading. The default logical mode needs shared_preload_libraries, a server restart, wal_level=logical and the appropriate improv.database worker setting. Logical results arrive asynchronously; use explicit recalculation when a transaction must immediately see current results.
Monitor improv.status and cap retained WAL with max_slot_wal_keep_size. Logical replication slots can retain WAL while a worker stalls. Binding tables can create publications and change replica identity; account for those effects before enabling logical mode.
Formula and Maintenance Boundaries
The improv language supports scalar formulas as well as model expressions, but not arbitrary SQL calls or external I/O. Formula errors normally become null; improv.raise_errors changes that policy. Numeric values and large integers pass through floating-point evaluation, so precision beyond 2^53 needs care. improv.max_cells limits loaded input cells.
Back up model definitions and result state with database dumps and rehearse restoration; logical mode needs a fresh slot and recomputation after restore. Library upgrades require restarting preloaded processes and updating the extension SQL. Model computation is distinct from an application transaction’s source-of-truth tables.
Model Access Policies in 0.13.0
Models execute with their owner’s privileges. Grant improv_user to model creators and give them the required source-table privileges. Version 0.13.0 adds Cedar policies through improv.set_policies, inspection through improv.policies, and decision explanations through improv.explain_access.
Grant improv_reader (or improv_user) to restricted users and separately grant access to result tables. Policies filter result rows and the improv.categories, improv.items, improv.measures and improv.cells functions. Superusers, the owner and roles allowed to act as the owner bypass these policies. A model without policies retains its ordinary grant behavior; configured policies deny by default, and invalid policies deny access to restricted users.
Derived values are calculated over all owner-visible inputs before filtering. Hiding an input does not remove its contribution from an allowed total. Model policies do not restrict direct access to source tables. Permitted cell edits and policy changes are recorded in improv.policy_audit; rejected operations are logged by the server. Review grants and totals before exposing a model.
Upgrading to 0.13.0
Install matching files and restart PostgreSQL when the library is preloaded, then update each database:
The 0.12.2-to-0.13.0 migration adds the policy objects and functions without changing model rows. The release also fixes an upgrade deadlock with the logical-sync worker. Back up roles and model data and rehearse the update. Upstream now uses pgrx 0.19.3; this does not establish availability of a matching distribution package.