Getting ProvSQL
There are two ways to run ProvSQL:
Installing from source (recommended) – full-featured, suitable for production use and development.
Docker container – no installation required, ideal for quickly trying ProvSQL without modifying your system.
Installing from Source
This is the recommended approach. It gives full access to all features, including external knowledge-compilation tools.
Getting the Source
Releases are available on the ProvSQL website and on the GitHub releases page. The source repository is hosted at https://github.com/PierreSenellart/provsql.
To clone the development version directly:
git clone https://github.com/PierreSenellart/provsql.git
Prerequisites
PostgreSQL ≥ 10. ProvSQL has been tested with versions 10–18 under Linux, macOS (x86-64 and ARM), and Windows Subsystem for Linux.
Build tools.
make, a C/C++ compiler supporting C++17, and PostgreSQL development headers (e.g.,postgresql-server-dev-XXon Debian-based systems, or thepostgresqlHomebrew formula on macOS).uuid-ossp PostgreSQL extension (included with most PostgreSQL packages; compile
contrib/when building from source).Boost libraries –
libboost-devandlibboost-serialization-dev(Debian/Ubuntu), or equivalent.(Optional) Knowledge-compilation tools for probability computation:
Each tool must be installed as an executable reachable in the PATH of the PostgreSQL server process (e.g.,
/usr/local/bin/).(Optional) graph-easy for circuit visualisation (
libgraph-easy-perlon Debian-based systems, or CPAN).
Installation
Compile:
makeTo select a specific PostgreSQL installation, adjust the
pg_configpath inMakefile.internal.Install (as a user with write access to the PostgreSQL directories):
make install
Enable the extension hook. Add the following line to postgresql.conf (typically
/etc/postgresql/VERSION/main/postgresql.confon Linux):shared_preload_libraries = 'provsql'
Then restart the PostgreSQL server:
service postgresql restart
Important
The shared_preload_libraries step is mandatory. ProvSQL installs a planner hook that rewrites queries transparently; without it the extension loads but provenance tracking is silently disabled.
In each database where you want to use ProvSQL, load the extension:
CREATE EXTENSION provsql CASCADE;
The
CASCADEkeyword automatically installs the requireduuid-osspextension if it is not already present.
Testing Your Installation
Run the full regression suite as a PostgreSQL superuser:
make test
If tests fail, the pager (usually less) is launched on the diff between
expected and actual output.
Note
To run the tests as a non-default user, grant yourself superuser rights first:
ALTER USER your_login WITH SUPERUSER;
This assumes your_login is already a PostgreSQL user; on Debian-based
systems you can create it by running createuser your_login as the
postgres system user.
If your PostgreSQL server does not listen on the default port (5432), add
--port=xxxx to the EXTRA_REGRESS_OPTS line of Makefile.internal.
Tests that depend on optional external tools (c2d, d4, dsharp,
minic2d, weightmc, graph-easy) will fail if no executable of
that name can be found.
Uninstalling
make uninstall
Then remove the provsql entry from shared_preload_libraries in
postgresql.conf and restart the server.
Docker Container
For a quick trial without any local installation, a demonstration Docker
container is available. It is full-featured except for c2d and
minic2d support:
docker run inriavalda/provsql
Follow the on-screen instructions to connect to the PostgreSQL server inside the container with a PostgreSQL client.
License
ProvSQL is open-source software distributed under the MIT License.
See the LICENSE file at the root of the repository or
view it on GitHub.