Skip to content

pg_improv

Incremental multidimensional models and formula functions over PostgreSQL tables.

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.14.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
Commit/logical modes need preload; policies bypassed by owners.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 0.14.0 18 17 16 15 14 pg_improv -
RPM PIGSTY 0.14.0 18 17 16 15 14 pg_improv_$v -
DEB PIGSTY 0.14.0 18 17 16 15 14 postgresql-$v-pg-improv -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
el8.aarch64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
el9.x86_64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
el9.aarch64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
el10.x86_64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
el10.aarch64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
d12.x86_64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
d12.aarch64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
d13.x86_64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
d13.aarch64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
u22.x86_64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
u22.aarch64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
u24.x86_64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
u24.aarch64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
u26.x86_64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
u26.aarch64 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 PIGSTY 0.14.0 N/A
Package Version OS ORG SIZE File URL
pg_improv_18 0.14.0 el8.x86_64 pigsty 5.3 MiB pg_improv_18-0.14.0-1PGSTY.el8.x86_64.rpm
pg_improv_18 0.14.0 el8.aarch64 pigsty 4.4 MiB pg_improv_18-0.14.0-1PGSTY.el8.aarch64.rpm
pg_improv_18 0.14.0 el9.x86_64 pigsty 5.1 MiB pg_improv_18-0.14.0-1PGSTY.el9.x86_64.rpm
pg_improv_18 0.14.0 el9.aarch64 pigsty 4.5 MiB pg_improv_18-0.14.0-1PGSTY.el9.aarch64.rpm
pg_improv_18 0.14.0 el10.x86_64 pigsty 5.1 MiB pg_improv_18-0.14.0-1PGSTY.el10.x86_64.rpm
pg_improv_18 0.14.0 el10.aarch64 pigsty 4.5 MiB pg_improv_18-0.14.0-1PGSTY.el10.aarch64.rpm
postgresql-18-pg-improv 0.14.0 d12.x86_64 pigsty 4.4 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~bookworm_amd64.deb
postgresql-18-pg-improv 0.14.0 d12.aarch64 pigsty 3.7 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~bookworm_arm64.deb
postgresql-18-pg-improv 0.14.0 d13.x86_64 pigsty 4.4 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~trixie_amd64.deb
postgresql-18-pg-improv 0.14.0 d13.aarch64 pigsty 3.7 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~trixie_arm64.deb
postgresql-18-pg-improv 0.14.0 u22.x86_64 pigsty 4.8 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~jammy_amd64.deb
postgresql-18-pg-improv 0.14.0 u22.aarch64 pigsty 4.3 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~jammy_arm64.deb
postgresql-18-pg-improv 0.14.0 u24.x86_64 pigsty 4.8 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~noble_amd64.deb
postgresql-18-pg-improv 0.14.0 u24.aarch64 pigsty 4.3 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~noble_arm64.deb
postgresql-18-pg-improv 0.14.0 u26.x86_64 pigsty 4.8 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~resolute_amd64.deb
postgresql-18-pg-improv 0.14.0 u26.aarch64 pigsty 4.3 MiB postgresql-18-pg-improv_0.14.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_improv_17 0.14.0 el8.x86_64 pigsty 5.3 MiB pg_improv_17-0.14.0-1PGSTY.el8.x86_64.rpm
pg_improv_17 0.14.0 el8.aarch64 pigsty 4.4 MiB pg_improv_17-0.14.0-1PGSTY.el8.aarch64.rpm
pg_improv_17 0.14.0 el9.x86_64 pigsty 5.1 MiB pg_improv_17-0.14.0-1PGSTY.el9.x86_64.rpm
pg_improv_17 0.14.0 el9.aarch64 pigsty 4.5 MiB pg_improv_17-0.14.0-1PGSTY.el9.aarch64.rpm
pg_improv_17 0.14.0 el10.x86_64 pigsty 5.1 MiB pg_improv_17-0.14.0-1PGSTY.el10.x86_64.rpm
pg_improv_17 0.14.0 el10.aarch64 pigsty 4.5 MiB pg_improv_17-0.14.0-1PGSTY.el10.aarch64.rpm
postgresql-17-pg-improv 0.14.0 d12.x86_64 pigsty 4.4 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~bookworm_amd64.deb
postgresql-17-pg-improv 0.14.0 d12.aarch64 pigsty 3.7 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~bookworm_arm64.deb
postgresql-17-pg-improv 0.14.0 d13.x86_64 pigsty 4.4 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~trixie_amd64.deb
postgresql-17-pg-improv 0.14.0 d13.aarch64 pigsty 3.7 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~trixie_arm64.deb
postgresql-17-pg-improv 0.14.0 u22.x86_64 pigsty 4.8 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~jammy_amd64.deb
postgresql-17-pg-improv 0.14.0 u22.aarch64 pigsty 4.3 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~jammy_arm64.deb
postgresql-17-pg-improv 0.14.0 u24.x86_64 pigsty 4.8 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~noble_amd64.deb
postgresql-17-pg-improv 0.14.0 u24.aarch64 pigsty 4.3 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~noble_arm64.deb
postgresql-17-pg-improv 0.14.0 u26.x86_64 pigsty 4.8 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~resolute_amd64.deb
postgresql-17-pg-improv 0.14.0 u26.aarch64 pigsty 4.3 MiB postgresql-17-pg-improv_0.14.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_improv_16 0.14.0 el8.x86_64 pigsty 5.3 MiB pg_improv_16-0.14.0-1PGSTY.el8.x86_64.rpm
pg_improv_16 0.14.0 el8.aarch64 pigsty 4.4 MiB pg_improv_16-0.14.0-1PGSTY.el8.aarch64.rpm
pg_improv_16 0.14.0 el9.x86_64 pigsty 5.1 MiB pg_improv_16-0.14.0-1PGSTY.el9.x86_64.rpm
pg_improv_16 0.14.0 el9.aarch64 pigsty 4.6 MiB pg_improv_16-0.14.0-1PGSTY.el9.aarch64.rpm
pg_improv_16 0.14.0 el10.x86_64 pigsty 5.1 MiB pg_improv_16-0.14.0-1PGSTY.el10.x86_64.rpm
pg_improv_16 0.14.0 el10.aarch64 pigsty 4.5 MiB pg_improv_16-0.14.0-1PGSTY.el10.aarch64.rpm
postgresql-16-pg-improv 0.14.0 d12.x86_64 pigsty 4.4 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~bookworm_amd64.deb
postgresql-16-pg-improv 0.14.0 d12.aarch64 pigsty 3.7 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~bookworm_arm64.deb
postgresql-16-pg-improv 0.14.0 d13.x86_64 pigsty 4.4 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~trixie_amd64.deb
postgresql-16-pg-improv 0.14.0 d13.aarch64 pigsty 3.7 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~trixie_arm64.deb
postgresql-16-pg-improv 0.14.0 u22.x86_64 pigsty 4.8 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~jammy_amd64.deb
postgresql-16-pg-improv 0.14.0 u22.aarch64 pigsty 4.3 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~jammy_arm64.deb
postgresql-16-pg-improv 0.14.0 u24.x86_64 pigsty 4.8 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~noble_amd64.deb
postgresql-16-pg-improv 0.14.0 u24.aarch64 pigsty 4.3 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~noble_arm64.deb
postgresql-16-pg-improv 0.14.0 u26.x86_64 pigsty 4.8 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~resolute_amd64.deb
postgresql-16-pg-improv 0.14.0 u26.aarch64 pigsty 4.3 MiB postgresql-16-pg-improv_0.14.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_improv_15 0.14.0 el8.x86_64 pigsty 5.2 MiB pg_improv_15-0.14.0-1PGSTY.el8.x86_64.rpm
pg_improv_15 0.14.0 el8.aarch64 pigsty 4.3 MiB pg_improv_15-0.14.0-1PGSTY.el8.aarch64.rpm
pg_improv_15 0.14.0 el9.x86_64 pigsty 5.1 MiB pg_improv_15-0.14.0-1PGSTY.el9.x86_64.rpm
pg_improv_15 0.14.0 el9.aarch64 pigsty 4.5 MiB pg_improv_15-0.14.0-1PGSTY.el9.aarch64.rpm
pg_improv_15 0.14.0 el10.x86_64 pigsty 5.1 MiB pg_improv_15-0.14.0-1PGSTY.el10.x86_64.rpm
pg_improv_15 0.14.0 el10.aarch64 pigsty 4.6 MiB pg_improv_15-0.14.0-1PGSTY.el10.aarch64.rpm
postgresql-15-pg-improv 0.14.0 d12.x86_64 pigsty 4.4 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~bookworm_amd64.deb
postgresql-15-pg-improv 0.14.0 d12.aarch64 pigsty 3.7 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~bookworm_arm64.deb
postgresql-15-pg-improv 0.14.0 d13.x86_64 pigsty 4.4 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~trixie_amd64.deb
postgresql-15-pg-improv 0.14.0 d13.aarch64 pigsty 3.7 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~trixie_arm64.deb
postgresql-15-pg-improv 0.14.0 u22.x86_64 pigsty 4.8 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~jammy_amd64.deb
postgresql-15-pg-improv 0.14.0 u22.aarch64 pigsty 4.3 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~jammy_arm64.deb
postgresql-15-pg-improv 0.14.0 u24.x86_64 pigsty 4.8 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~noble_amd64.deb
postgresql-15-pg-improv 0.14.0 u24.aarch64 pigsty 4.3 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~noble_arm64.deb
postgresql-15-pg-improv 0.14.0 u26.x86_64 pigsty 4.8 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~resolute_amd64.deb
postgresql-15-pg-improv 0.14.0 u26.aarch64 pigsty 4.3 MiB postgresql-15-pg-improv_0.14.0-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_improv;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_improv;		# install via package name, for the active PG version

pig install pg_improv -v 18;   # install for PG 18
pig install pg_improv -v 17;   # install for PG 17
pig install pg_improv -v 16;   # install for PG 16
pig install pg_improv -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION pg_improv;

Usage

Sources:

pg_improv 0.14.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

CREATE EXTENSION pg_improv;
CREATE TABLE sales (quarter text, price float8, qty float8);
INSERT INTO sales VALUES ('Q1', 10, 100), ('Q2', 12, 200);
SELECT improv.create_model('plan');
SELECT improv.set_sync_mode('plan', 'manual');
SELECT improv.bind_category('plan', 'Time', 'sales', 'quarter');
SELECT improv.bind_measure('plan', 'Price', 'sales', 'price');
SELECT improv.bind_measure('plan', 'Quantity', 'sales', 'qty');
SELECT improv.define('plan', 'Revenue = Price * Quantity');
SELECT improv.recalc('plan');
SELECT * FROM improv_plan.revenue;
SELECT * FROM improv.status('plan');

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.

SELECT * FROM improv.policies('plan');
SELECT * FROM improv.explain_access('plan', 'Read');

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.14.0

Install matching files and restart PostgreSQL when the library is preloaded, then update each database:

ALTER EXTENSION pg_improv UPDATE TO '0.14.0';

The 0.13.0-to-0.14.0 SQL update only records the extension version. The library fix makes the logical-sync worker consistently report a model owner’s REVOKE with the owner and affected columns instead of failing later with a bare permission error. Install matching files, restart preloaded processes, and update each database; rehearse this operation with model backups. Other 0.14 changes concern Improv clients, servers, TLS and the GUI rather than the pg_improv SQL API. RPM 0.13.0 and DEB 0.12.2 remain the currently known package coordinates.

Table reader