Skip to content
provsql

provsql

provsql : Semiring provenance and uncertainty management for PostgreSQL

Overview

ID Extension Package Version Category License Language
2900
provsql
provsql
1.2.3
FEAT
MIT
C++
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--sLdt-
No
Yes
Yes
Yes
no
yes
Relationships
Requires
uuid-ossp

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
1.2.3
18
17
16
15
14
provsql uuid-ossp
RPM
PIGSTY
1.2.3
18
17
16
15
14
provsql_$v -
DEB
PIGSTY
1.2.3
18
17
16
15
14
postgresql-$v-provsql -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
el8.aarch64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
el9.x86_64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
el9.aarch64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
el10.x86_64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
el10.aarch64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
d12.x86_64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
d12.aarch64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
d13.x86_64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
d13.aarch64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
u22.x86_64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
u22.aarch64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
u24.x86_64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
u24.aarch64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
u26.x86_64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
u26.aarch64
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
PIGSTY 1.2.3
Package Version OS ORG SIZE File URL
provsql_18 1.2.3 el8.x86_64 pigsty 313.0 KiB provsql_18-1.2.3-1PIGSTY.el8.x86_64.rpm
provsql_18 1.2.3 el8.aarch64 pigsty 289.8 KiB provsql_18-1.2.3-1PIGSTY.el8.aarch64.rpm
provsql_18 1.2.3 el9.x86_64 pigsty 321.4 KiB provsql_18-1.2.3-1PIGSTY.el9.x86_64.rpm
provsql_18 1.2.3 el9.aarch64 pigsty 307.1 KiB provsql_18-1.2.3-1PIGSTY.el9.aarch64.rpm
provsql_18 1.2.3 el10.x86_64 pigsty 323.8 KiB provsql_18-1.2.3-1PIGSTY.el10.x86_64.rpm
provsql_18 1.2.3 el10.aarch64 pigsty 296.5 KiB provsql_18-1.2.3-1PIGSTY.el10.aarch64.rpm
postgresql-18-provsql 1.2.3 d12.x86_64 pigsty 271.0 KiB postgresql-18-provsql_1.2.3-1PIGSTY~bookworm_amd64.deb
postgresql-18-provsql 1.2.3 d12.aarch64 pigsty 239.3 KiB postgresql-18-provsql_1.2.3-1PIGSTY~bookworm_arm64.deb
postgresql-18-provsql 1.2.3 d13.x86_64 pigsty 295.5 KiB postgresql-18-provsql_1.2.3-1PIGSTY~trixie_amd64.deb
postgresql-18-provsql 1.2.3 d13.aarch64 pigsty 257.7 KiB postgresql-18-provsql_1.2.3-1PIGSTY~trixie_arm64.deb
postgresql-18-provsql 1.2.3 u22.x86_64 pigsty 285.5 KiB postgresql-18-provsql_1.2.3-1PIGSTY~jammy_amd64.deb
postgresql-18-provsql 1.2.3 u22.aarch64 pigsty 268.6 KiB postgresql-18-provsql_1.2.3-1PIGSTY~jammy_arm64.deb
postgresql-18-provsql 1.2.3 u24.x86_64 pigsty 297.9 KiB postgresql-18-provsql_1.2.3-1PIGSTY~noble_amd64.deb
postgresql-18-provsql 1.2.3 u24.aarch64 pigsty 279.5 KiB postgresql-18-provsql_1.2.3-1PIGSTY~noble_arm64.deb
postgresql-18-provsql 1.2.3 u26.x86_64 pigsty 306.6 KiB postgresql-18-provsql_1.2.3-1PIGSTY~resolute_amd64.deb
postgresql-18-provsql 1.2.3 u26.aarch64 pigsty 284.2 KiB postgresql-18-provsql_1.2.3-1PIGSTY~resolute_arm64.deb

Source

pig build pkg provsql;		# 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 provsql;		# install via package name, for the active PG version

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

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'provsql';

Create this extension with:

CREATE EXTENSION provsql CASCADE; -- requires uuid-ossp

Usage

Sources: README, getting started, user docs, SQL API index

provsql adds semiring provenance and uncertainty management to PostgreSQL. Upstream documents provenance tracking, semiring evaluation, probabilities, Shapley and Banzhaf values, where-provenance, update provenance, and temporal features.

Load the extension

shared_preload_libraries = 'provsql'
CREATE EXTENSION provsql CASCADE;

The CASCADE form installs uuid-ossp automatically if needed. The getting-started guide says the preload step is mandatory because ProvSQL installs a planner hook.

Enable provenance on tables

SELECT provsql.add_provenance('mytable');

SELECT name, provenance()
FROM mytable;

SELECT provsql.remove_provenance('mytable');

The user docs also describe provenance mappings:

SELECT create_provenance_mapping('my_mapping', 'mytable', 'column_name');
SELECT create_provenance_mapping_view('my_mapping_view', 'mytable', 'column_name');

Probability and semiring workflows

Assign probabilities to tuple tokens:

SELECT set_prob(provenance(), 0.8)
FROM mytable
WHERE id = 1;

Evaluate provenance in a semiring:

SELECT city,
       provenance_evaluate(
         provenance(),
         'personnel_level',
         'unclassified'::classification_level,
         'security_plus',
         'security_times'
       )
FROM (SELECT DISTINCT city FROM personnel) AS t;

Compute influence scores:

SELECT shapley(provenance(), m.token)
FROM my_mapping AS m;

The docs also describe shapley_all_vars, banzhaf, and banzhaf_all_vars.

Extra modes

Session GUCs documented upstream include:

SET provsql.where_provenance = on;
SET provsql.update_provenance = on;

The user guide separately documents temporal helpers such as get_valid_time, timetravel, timeslice, history, and undo.

Notes

  • Upstream tests ProvSQL on PostgreSQL 10 through 18.
  • Git tags show v1.2.3 as the current packaged release in the repository.
Last updated on