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

IDExtensionPackageVersionCategoryLicenseLanguage
2580pg_improvpg_improv0.15.0OLAPMITRust
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d--NoYesNoYesnono
Relationships
Schemasimprov
Commit/logical modes need preload; policies bypassed by owners.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.15.019 18 17 16 15pg_improv-
RPMPIGSTY0.15.019 18 17 16 15pg_improv_$v-
DEBPIGSTY0.15.019 18 17 16 15postgresql-$v-pg-improv-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.14.0PIGSTY 0.14.0PIGSTY 0.14.0PIGSTY 0.14.0
el8.aarch64N/APIGSTY 0.14.0PIGSTY 0.14.0PIGSTY 0.14.0PIGSTY 0.14.0
el9.x86_64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
el9.aarch64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
el10.x86_64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
el10.aarch64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
d12.x86_64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
d12.aarch64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
d13.x86_64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
d13.aarch64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
u22.x86_64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
u22.aarch64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
u24.x86_64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
u24.aarch64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
u26.x86_64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
u26.aarch64PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0PIGSTY 0.15.0
PackageVersionOSORGSIZEFile URL
pg_improv_190.15.0el9.x86_64pigsty4.8 MiBpg_improv_19-0.15.0-1PGSTY.el9.x86_64.rpm
pg_improv_190.15.0el9.aarch64pigsty4.4 MiBpg_improv_19-0.15.0-1PGSTY.el9.aarch64.rpm
pg_improv_190.15.0el10.x86_64pigsty4.8 MiBpg_improv_19-0.15.0-1PGSTY.el10.x86_64.rpm
pg_improv_190.15.0el10.aarch64pigsty4.4 MiBpg_improv_19-0.15.0-1PGSTY.el10.aarch64.rpm
postgresql-19-pg-improv0.15.0d12.x86_64pigsty4.2 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~bookworm_amd64.deb
postgresql-19-pg-improv0.15.0d12.aarch64pigsty3.5 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~bookworm_arm64.deb
postgresql-19-pg-improv0.15.0d13.x86_64pigsty4.2 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~trixie_amd64.deb
postgresql-19-pg-improv0.15.0d13.aarch64pigsty3.5 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~trixie_arm64.deb
postgresql-19-pg-improv0.15.0u22.x86_64pigsty4.5 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~jammy_amd64.deb
postgresql-19-pg-improv0.15.0u22.aarch64pigsty4.1 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~jammy_arm64.deb
postgresql-19-pg-improv0.15.0u24.x86_64pigsty4.5 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~noble_amd64.deb
postgresql-19-pg-improv0.15.0u24.aarch64pigsty4.1 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~noble_arm64.deb
postgresql-19-pg-improv0.15.0u26.x86_64pigsty4.5 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~resolute_amd64.deb
postgresql-19-pg-improv0.15.0u26.aarch64pigsty4.1 MiBpostgresql-19-pg-improv_0.15.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_improv_180.14.0el8.x86_64pigsty5.3 MiBpg_improv_18-0.14.0-1PGSTY.el8.x86_64.rpm
pg_improv_180.14.0el8.aarch64pigsty4.4 MiBpg_improv_18-0.14.0-1PGSTY.el8.aarch64.rpm
pg_improv_180.15.0el9.x86_64pigsty4.8 MiBpg_improv_18-0.15.0-1PGSTY.el9.x86_64.rpm
pg_improv_180.15.0el9.aarch64pigsty4.3 MiBpg_improv_18-0.15.0-1PGSTY.el9.aarch64.rpm
pg_improv_180.15.0el10.x86_64pigsty4.8 MiBpg_improv_18-0.15.0-1PGSTY.el10.x86_64.rpm
pg_improv_180.15.0el10.aarch64pigsty4.3 MiBpg_improv_18-0.15.0-1PGSTY.el10.aarch64.rpm
postgresql-18-pg-improv0.15.0d12.x86_64pigsty4.2 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~bookworm_amd64.deb
postgresql-18-pg-improv0.15.0d12.aarch64pigsty3.5 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~bookworm_arm64.deb
postgresql-18-pg-improv0.15.0d13.x86_64pigsty4.2 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~trixie_amd64.deb
postgresql-18-pg-improv0.15.0d13.aarch64pigsty3.5 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~trixie_arm64.deb
postgresql-18-pg-improv0.15.0u22.x86_64pigsty4.5 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~jammy_amd64.deb
postgresql-18-pg-improv0.15.0u22.aarch64pigsty4.1 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~jammy_arm64.deb
postgresql-18-pg-improv0.15.0u24.x86_64pigsty4.5 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~noble_amd64.deb
postgresql-18-pg-improv0.15.0u24.aarch64pigsty4.1 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~noble_arm64.deb
postgresql-18-pg-improv0.15.0u26.x86_64pigsty4.5 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~resolute_amd64.deb
postgresql-18-pg-improv0.15.0u26.aarch64pigsty4.1 MiBpostgresql-18-pg-improv_0.15.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_improv_170.14.0el8.x86_64pigsty5.3 MiBpg_improv_17-0.14.0-1PGSTY.el8.x86_64.rpm
pg_improv_170.14.0el8.aarch64pigsty4.4 MiBpg_improv_17-0.14.0-1PGSTY.el8.aarch64.rpm
pg_improv_170.15.0el9.x86_64pigsty4.8 MiBpg_improv_17-0.15.0-1PGSTY.el9.x86_64.rpm
pg_improv_170.15.0el9.aarch64pigsty4.3 MiBpg_improv_17-0.15.0-1PGSTY.el9.aarch64.rpm
pg_improv_170.15.0el10.x86_64pigsty4.8 MiBpg_improv_17-0.15.0-1PGSTY.el10.x86_64.rpm
pg_improv_170.15.0el10.aarch64pigsty4.3 MiBpg_improv_17-0.15.0-1PGSTY.el10.aarch64.rpm
postgresql-17-pg-improv0.15.0d12.x86_64pigsty4.2 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~bookworm_amd64.deb
postgresql-17-pg-improv0.15.0d12.aarch64pigsty3.5 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~bookworm_arm64.deb
postgresql-17-pg-improv0.15.0d13.x86_64pigsty4.2 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~trixie_amd64.deb
postgresql-17-pg-improv0.15.0d13.aarch64pigsty3.5 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~trixie_arm64.deb
postgresql-17-pg-improv0.15.0u22.x86_64pigsty4.5 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~jammy_amd64.deb
postgresql-17-pg-improv0.15.0u22.aarch64pigsty4.1 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~jammy_arm64.deb
postgresql-17-pg-improv0.15.0u24.x86_64pigsty4.5 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~noble_amd64.deb
postgresql-17-pg-improv0.15.0u24.aarch64pigsty4.1 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~noble_arm64.deb
postgresql-17-pg-improv0.15.0u26.x86_64pigsty4.5 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~resolute_amd64.deb
postgresql-17-pg-improv0.15.0u26.aarch64pigsty4.1 MiBpostgresql-17-pg-improv_0.15.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_improv_160.14.0el8.x86_64pigsty5.3 MiBpg_improv_16-0.14.0-1PGSTY.el8.x86_64.rpm
pg_improv_160.14.0el8.aarch64pigsty4.4 MiBpg_improv_16-0.14.0-1PGSTY.el8.aarch64.rpm
pg_improv_160.15.0el9.x86_64pigsty4.8 MiBpg_improv_16-0.15.0-1PGSTY.el9.x86_64.rpm
pg_improv_160.15.0el9.aarch64pigsty4.3 MiBpg_improv_16-0.15.0-1PGSTY.el9.aarch64.rpm
pg_improv_160.15.0el10.x86_64pigsty4.8 MiBpg_improv_16-0.15.0-1PGSTY.el10.x86_64.rpm
pg_improv_160.15.0el10.aarch64pigsty4.3 MiBpg_improv_16-0.15.0-1PGSTY.el10.aarch64.rpm
postgresql-16-pg-improv0.15.0d12.x86_64pigsty4.2 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~bookworm_amd64.deb
postgresql-16-pg-improv0.15.0d12.aarch64pigsty3.5 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~bookworm_arm64.deb
postgresql-16-pg-improv0.15.0d13.x86_64pigsty4.2 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~trixie_amd64.deb
postgresql-16-pg-improv0.15.0d13.aarch64pigsty3.5 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~trixie_arm64.deb
postgresql-16-pg-improv0.15.0u22.x86_64pigsty4.5 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~jammy_amd64.deb
postgresql-16-pg-improv0.15.0u22.aarch64pigsty4.1 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~jammy_arm64.deb
postgresql-16-pg-improv0.15.0u24.x86_64pigsty4.5 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~noble_amd64.deb
postgresql-16-pg-improv0.15.0u24.aarch64pigsty4.1 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~noble_arm64.deb
postgresql-16-pg-improv0.15.0u26.x86_64pigsty4.5 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~resolute_amd64.deb
postgresql-16-pg-improv0.15.0u26.aarch64pigsty4.1 MiBpostgresql-16-pg-improv_0.15.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_improv_150.14.0el8.x86_64pigsty5.2 MiBpg_improv_15-0.14.0-1PGSTY.el8.x86_64.rpm
pg_improv_150.14.0el8.aarch64pigsty4.3 MiBpg_improv_15-0.14.0-1PGSTY.el8.aarch64.rpm
pg_improv_150.15.0el9.x86_64pigsty4.8 MiBpg_improv_15-0.15.0-1PGSTY.el9.x86_64.rpm
pg_improv_150.15.0el9.aarch64pigsty4.3 MiBpg_improv_15-0.15.0-1PGSTY.el9.aarch64.rpm
pg_improv_150.15.0el10.x86_64pigsty4.8 MiBpg_improv_15-0.15.0-1PGSTY.el10.x86_64.rpm
pg_improv_150.15.0el10.aarch64pigsty4.4 MiBpg_improv_15-0.15.0-1PGSTY.el10.aarch64.rpm
postgresql-15-pg-improv0.15.0d12.x86_64pigsty4.2 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~bookworm_amd64.deb
postgresql-15-pg-improv0.15.0d12.aarch64pigsty3.5 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~bookworm_arm64.deb
postgresql-15-pg-improv0.15.0d13.x86_64pigsty4.2 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~trixie_amd64.deb
postgresql-15-pg-improv0.15.0d13.aarch64pigsty3.5 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~trixie_arm64.deb
postgresql-15-pg-improv0.15.0u22.x86_64pigsty4.5 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~jammy_amd64.deb
postgresql-15-pg-improv0.15.0u22.aarch64pigsty4.1 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~jammy_arm64.deb
postgresql-15-pg-improv0.15.0u24.x86_64pigsty4.5 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~noble_amd64.deb
postgresql-15-pg-improv0.15.0u24.aarch64pigsty4.1 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~noble_arm64.deb
postgresql-15-pg-improv0.15.0u26.x86_64pigsty4.5 MiBpostgresql-15-pg-improv_0.15.0-1PGSTY~resolute_amd64.deb
postgresql-15-pg-improv0.15.0u26.aarch64pigsty4.1 MiBpostgresql-15-pg-improv_0.15.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 by package name

pig install pg_improv -v 19;   # install for PG 19
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.15.0 binds PostgreSQL tables to multidimensional models, evaluates formulas and materializes results. It supports PostgreSQL 15–19 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.

PostgreSQL 19

Release 0.15.0 adds PostgreSQL 19 builds and tests, including a PostgreSQL 18-to-19 upgrade check. Desktop, Android and DuckDB additions in the same distribution are separate from the PostgreSQL extension’s SQL workflow.

Table reader