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.10.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
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.10.0 |
18 17 16 15 14 | pg_improv |
- |
| RPM | PIGSTY | 0.10.0 |
18 17 16 15 14 | pg_improv_$v |
- |
| DEB | PIGSTY | 0.10.0 |
18 17 16 15 14 | postgresql-$v-pg-improv |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| el8.aarch64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| el9.x86_64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| el9.aarch64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| el10.x86_64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| el10.aarch64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| d12.x86_64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| d12.aarch64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| d13.x86_64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| d13.aarch64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| u22.x86_64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| u22.aarch64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| u24.x86_64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| u24.aarch64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| u26.x86_64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
| u26.aarch64 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | PIGSTY 0.10.0 | N/A |
Source
codeberg.org/gregburd/improv
improv-0.10.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.10.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.