pg_warren
pg_warren : Versioned graph traversal and computation over PostgreSQL tables
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2645 | pg_warren | pg_warren | 0.8.0 |
FEAT | Apache-2.0 | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-dt- | No | Yes | No | Yes | no | yes |
| Relationships | |
|---|---|
| Schemas | warren |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| el8.aarch64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| el9.x86_64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| el9.aarch64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| el10.x86_64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| el10.aarch64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| d12.x86_64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| d12.aarch64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| d13.x86_64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| d13.aarch64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| u22.x86_64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| u22.aarch64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| u24.x86_64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| u24.aarch64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| u26.x86_64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
| u26.aarch64 | N/A | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 | PIGSTY 0.8.0 |
Source
github.com/ExaDev/pg_warren
pg_warren-0.8.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
pg_warren 0.8.0 builds versioned adjacency snapshots from ordinary PostgreSQL tables for graph traversal and computation. It supports PostgreSQL 15–18 and keeps graph versions, vectors and their changes within PostgreSQL transactions. Traversal reads a built snapshot; source-table changes require an explicit refresh.
Core Workflow
This is a trusted extension: a role with CREATE privilege on the database can install it. A basic graph needs node and edge queries:
The graph stores its source queries. Run warren.refresh after changing the source tables; use warren.info to inspect versions and warren.diff to compare them. Building and promoting versions rolls back with the surrounding transaction.
Traversal and Computation
| Interface | Purpose |
|---|---|
warren.bfs, warren.shortest_path |
Breadth-first traversal and shortest paths |
warren.pagerank, warren.components |
Rank nodes and find connected components |
warren.leiden |
Detect communities |
warren.spmv, warren.gather |
Compose graph calculations with SQL |
warren.vector_topk |
Read the largest values from a stored vector |
warren.shared_cache, warren.backends |
Inspect shared entries and backend cache usage |
Identifier types must agree with the graph. Functions without a node identifier argument may require a type witness such as NULL::bigint. In 0.8.0, PageRank and Leiden use native kernels; they write their results to named vectors.
Memory and Preload
PostgreSQL 17–18 initialize the shared cache on first use. PostgreSQL 15–16 need the following setting and a server restart to share graph data between backends:
Without preload on PostgreSQL 15–16, graph operations still work using private backend caches. Add the library to any existing preload list.
warren.shared_cache_memory limits the cluster-wide shared cache and takes effect on configuration reload. warren.max_cache_memory, warren.max_compute_memory and warren.max_build_memory limit distinct private-cache, computation and build allocations; they are not one combined memory budget. warren.threads controls computation parallelism. On Linux, shared entries also need sufficient /dev/shm; entries that do not fit fall back to private caches.
Access, Backups and Upgrades
Source queries run as the graph owner with the stored search_path. Use schema-qualified source objects and controlled schemas. Public functions enforce graph access; installation does not grant direct access to private catalog tables.
Dump as a superuser to include graph catalogs, versions and vectors, and restore the required owner/reader roles first. Rebuilding from source tables does not preserve historical graph versions. After installing newer library files, run ALTER EXTENSION pg_warren UPDATE in each database using the extension. Dropping it removes stored graphs. The project remains pre-1.0 and does not maintain graph snapshots incrementally.