pgGraph 1.0.0

This Release
pgGraph 1.0.0
Date
Status
Stable
Other Releases
Abstract
Graph database superpowers for your existing Postgres
Description
pgGraph lets you run complex graph queries, like finding shortest paths, mapping relationships, and discovering networks, directly on your existing PostgreSQL tables using standard SQL. Postgres remains your single source of truth.
Released By
evokoa
License
Apache 2.0
Resources
Special Files
Tags

Extensions

graph 1.0.0

Documentation

04-projection-storage-sync
Projection, Storage, And Sync
qa-01-write-correctness-matrix-plan
QA-01 Advertised Write Correctness Matrix
03-planner-runtime
Planner And Streaming Runtime
2026-07-16-r2d-generation-publication-baseline
R2D Generation Publication Baseline — 2026-07-16
requirements
requirements
02-production-readiness
1.0 Production Readiness Plan
10-reconciliation-with-dev-1.0
Reconciliation — New Todo (Doc 09) vs The dev 1.0 Release Line
README
Benchmarks
06-quality-performance-operations
Quality, Performance, And Operations
08-postgresql-19-property-graphs
PostgreSQL 19 Native Property Graph Support
layered
layered
out-of-core-build-plan
Out-Of-Core Graph Build Plan
README_zh
pgGraph
03-documentation-and-api
1.0 Documentation And Public API Plan
2026-07-15-r2a-resource-policy
R2A Checked Resource Policy Evidence
README
Full Graph Engine Program
CODE_OF_CONDUCT
Code of Conduct
03-implementation-review-findings
Implementation Review — Findings, Ranked By Severity
10-rust-type-safety-pgrx-boundaries
Rust Type Safety, Unsafe, And pgrx Boundary Plan
04-playground-and-scripts
Playground And Scripts Overhaul Plan
ki-023-definer-search-path-plan
KI-023 Security-Definer Search-Path Plan
00-overview
Secondary Review — Overview
CONTRIBUTING
Contributing to pgGraph
06-path-to-full-graph-engine
Strategy — Turning pgGraph Into A Real Graph Engine Inside Postgres
2026-07-16-r3d-direct-persisted-build
R3D Direct Persisted Build — 2026-07-16
README
pgrx SQL Tests
README
pgGraph 1.0 Release Program
05-release-candidate-checklist
1.0 Release Candidate Checklist
ki-020-owning-mapped-layout-plan
KI-020 Owning Mapped Layout Plan
README
pg_regress Smoke
12-sync-log-retention-plan
Sync-Log Retention Plan (C3)
lib
lib
02-gql-conformance
Full GQL Conformance Plan
2026-07-15-r2b-live-build-budget
R2B Live Build Budget Evidence
2026-07-16-r3c-artifact-v5
R3C Artifact v5 And Bounded Load — 2026-07-16
ki-026-durable-node-plan
KI-026 Durable Node Identity Plan
08-plan-delta-for-graph-engine-strategy
Plan Delta — What The Graph-Engine Strategy Changes In Doc 07
01-sync-architecture-review
Sync Architecture Review — What Actually Happens On A Write
01-memory-governance
Memory Governance And Out-Of-Core Execution
2026-07-16-r4-release-risk-refactor
R4 Release-Risk Refactoring — 2026-07-16
readme
pgGraph Sandbox
README
Release Compatibility Fixtures
09-public-backlog-closure
Public Roadmap And Known-Issues Closure Ledger
01-compatibility-and-lifecycle
1.0 Compatibility And Lifecycle Plan
feature_request
feature_request
README
SQL Test Directories
scripts
Scripts
bug_report
bug_report
05-suggested-todos
Suggested Secondary Todo List
2026-07-16-r3b-governed-runs
R3B Governed Build Runs — 2026-07-16
AGENTS
Package Manager Safety Wrapper
11-schema-flexible-dynamic-graphs
Schema-Flexible Dynamic Labels And JSONB Properties
00-codebase-review
Codebase Review
2026-07-14-durable-projection-matrix
PostgreSQL 14-18 Durable Projection Matrix — 2026-07-14
2026-07-16-r5-supported-profile
R5 Supported Profile Evidence — 2026-07-16
2026-07-16-r3c-artifact-v6
R3C Artifact v6 Tenant-Safe Follow-Up — 2026-07-16
README
Heavy SQL Tests
progress
Todo Program Progress
2026-07-14-postgres-process-sanitizer
PostgreSQL-Process Sanitizer Evidence — 2026-07-14
2026-07-16-r3a-source-boundary
R3A Coherent Source Boundary — 2026-07-16
progress
Full Graph Engine Progress
r3-bounded-storage-execution-plan
R3 Bounded Storage Execution Plan
09-revised-build-sequence
Revised Build Sequence — v2 (Supersedes Doc 07)
2026-07-14-pg14-18-matrix
PostgreSQL 14-18 Release Matrix — 2026-07-14
05-refactor-plan
Refactor Plan
07-build-order
Build Order
02-dual-mode-design-proposal
Design Proposal — CSR / Live / Hybrid Operating Modes
2026-07-16-r7-release-ready
R7 Release-Ready Evidence
04-docs-and-todo-audit
Docs & Todo-Register Audit
SECURITY
Security Policy
requirements
requirements
ki-027-persisted-rebuild-plan
KI-027 Persisted Rebuild Manifest Plan
2026-07-15-r2c-runtime-resource-breakers
R2C Runtime Resource Breakers
r2-resource-containment-plan
R2 Resource Containment And Safe Publication Plan
2026-07-16-r6-documentation-packaging
R6 Documentation, Packaging, CI, And Operations Evidence
07-completed-plan-build-sequence
Completed Plan — Build Sequence For The Post-v0.1.8 Work

README

pgGraph Banner

pgGraph pgGraph documentation

Graph database superpowers for your existing Postgres data.

GitHub stars Version 1.0.0 License: Apache-2.0 PostgreSQL 14-18 Docker image

GitHub issues GitHub pull requests Last commit

Built by Evokoa Follow on X Join the Evokoa Discord Follow on Product Hunt

pgGraph is a PostgreSQL extension for running graph search, traversal, shortest path, and relationship queries directly against ordinary PostgreSQL tables.

Your tables stay the source of truth. pgGraph builds a derived graph index and lets you query it from SQL using functions in the graph schema.

[!TIP] Looking for a managed version? We have launched a managed version of pgGraph on polygres.com for full high performance GraphRAG on Postgres.

Why pgGraph?

PostgreSQL is great at relational queries, but graph-style questions often require custom recursive SQL for each schema:

  • “Find records related to Alice within 2 hops.”
  • “Find the shortest path between this person and this company.”
  • “Search nodes across registered tables.”

pgGraph adds graph queries on top of your existing PostgreSQL tables, without requiring a separate graph database, graph-specific storage system, or a new query language.

Quickstart

The repository quickstart builds a disposable PostgreSQL 17 image:

git clone https://github.com/evokoa/pggraph.git
cd pggraph
scripts/quickstart.sh

The signed multi-architecture release image is ghcr.io/evokoa/pggraph:1.0.0. Verify its published digest before deployment.

Verify the extensions are loaded (uses psql inside the container, so you don’t need a local PostgreSQL client):

docker exec pggraph psql -U postgres -d graph \
  -c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('graph', 'pg_cron');"

If you have psql installed locally you can also connect directly:

psql -h localhost -U postgres -d graph

Homebrew Installation

The Evokoa Homebrew tap is the convenience channel for local PostgreSQL 17 extension installs.

brew tap Evokoa/tap
brew install pggraph
brew test pggraph

Create and verify the extension in a local database:

brew services start postgresql@17
psql -d postgres -c "CREATE EXTENSION graph;"
psql -d postgres -c "SELECT extname, extversion FROM pg_extension WHERE extname = 'graph';"

The formula installs pgGraph 1.0.0 from the signed release bundle.

To build from source or run the full interactive demo instead, use the included quickstart script. It starts a disposable Docker-backed PostgreSQL database, installs pgGraph, creates two normal PostgreSQL tables, discovers the foreign key relationship, builds the graph, and runs example queries. If the image’s scheduled maintenance is already active, the demo waits for that bounded operation to finish before building instead of failing with a transient lock.

You need Docker or Docker Desktop installed and running:

  • macOS: install Docker Desktop.
  • Windows: install Docker Desktop with WSL2 enabled, then run the script from WSL2 or Git Bash.
  • Linux: install Docker Engine and the Docker Compose plugin.
git clone https://github.com/evokoa/pggraph.git
cd pggraph

# run the full quickstart demo
scripts/quickstart.sh

# install into existing Postgres Docker container
scripts/quickstart.sh docker my-postgres 17 appdb postgres

# source build/install with pgrx into local PostgreSQL
scripts/quickstart.sh pgrx

# start Streamlit playground with a preset dataset and mode (csr|mutable)
scripts/quickstart.sh playground panama csr
scripts/quickstart.sh playground panama mutable

Supported modes:

  • quickstart / demo: build and start the Docker Postgres service, load demo data, and run example graph queries. This is the default mode.
  • setup: build and start Postgres with pgGraph installed, but do not load the sample graph.
  • psql: build and start Postgres, prepare demo data, then open psql.
  • docker CONTAINER [PG_MAJOR] [DB_NAME] [DB_USER]: install pgGraph into an existing running Postgres Docker container via scripts/install_into_docker_postgres.sh.
  • pgrx [PG_MAJOR]: build and install pgGraph into a local PostgreSQL using cargo pgrx install.
  • playground [panama|ldbc] [csr|mutable]: start the Streamlit playground using a preset dataset and projection mode.
  • clean: stop the Compose database and remove its volume.

The script works on macOS and Linux from a normal terminal, and on Windows from WSL2 or Git Bash with Docker Desktop. It is not a native PowerShell or Command Prompt script.

Docker images are published for PostgreSQL 14 through 18. Tags without a PostgreSQL major, such as 1.0.0 and latest, use the default PostgreSQL 17 image. PostgreSQL 13 is no longer an official support target after upstream EOL, though the legacy pg13 pgrx feature remains available on a best-effort basis. The PostgreSQL major version of the extension package must match the target server.

PGXN Source Installation

PGXN provides the verified source ZIP from the signed 1.0.0 release bundle. Because pgGraph is a Rust/pgrx extension, building from source requires the Rust toolchain.

Prerequisites

  • PostgreSQL development headers and pg_config
  • Rust toolchain (1.96, pinned by graph/rust-toolchain.toml)
  • cargo-pgrx 0.19.1

Install with pgxn-client

cargo install cargo-pgrx --version 0.19.1 --locked
# Register the installed PostgreSQL with pgrx (auto-detects the major):
PG_MAJOR=$(pg_config --version | sed -E 's/[^0-9]*([0-9]+).*/\1/')
cargo pgrx init --pg${PG_MAJOR}="$(which pg_config)"
pgxn install pgGraph

Manual source install

git clone https://github.com/evokoa/pggraph.git
cd pggraph
make install # may need sudo
psql -d postgres -c "CREATE EXTENSION graph;"

If you have multiple PostgreSQL installations, set PG_CONFIG to the target server’s pg_config, then re-run the installation:

export PG_CONFIG=/usr/lib/postgresql/17/bin/pg_config
make install

If sudo is needed for make install, preserve PG_CONFIG:

sudo --preserve-env=PG_CONFIG make install

If compilation fails with fatal error: postgres.h: No such file or directory, install the PostgreSQL server development package for the target PostgreSQL major, such as postgresql-server-dev-17 on Ubuntu or Debian.

Note: The PGXN distribution name is pgGraph but the PostgreSQL extension name is graph. Use CREATE EXTENSION graph; after installation.

Documentation

More information is available in the pgGraph docs:

Overview · Quickstart · Installation · Playground · Querying · SQL API

pgGraph: High-Speed Graph Execution Inside PostgreSQL

pgGraph is not “Postgres plus graph syntax.” It is a cache-friendly graph execution layer for data that already lives in your ordinary relational tables.

The core idea is simple but powerful: keep PostgreSQL as your system of record, but build a highly optimized, read-heavy graph runtime from that relational metadata. The result is closer to a rebuildable graph index than a graph database: it is built from Postgres tables, operated with Postgres controls, and optimized for repeated bounded traversal over known topology.

The Tech: Why It’s So Fast

Graph traversals usually die on recursive SQL queries or endless joins. pgGraph bypasses this by compiling your relational data into a specialized memory structure.

  • O(1) adjacency via CSR. graph.build() compiles your relationships into forward and reverse compressed sparse row (CSR) edge stores. A node’s neighbors are stored as a contiguous array slice. Instead of rediscovering relationships via SQL, traversals are executed as raw, graph-native memory scans.
  • A tight traversal loop. SQL-facing calls resolve coordinates, labels, filters, and tenant scopes before entering the traversal loop. Once inside, the engine streams CSR neighbors, checking compact u8 edge-label IDs, typed FilterIndex values, tenant bitmaps, active bits, and sync overlays.
  • Read-only artifact mapping. Persisted .pggraph artifacts are written atomically. When a new Postgres backend spins up, it validates the artifact and maps immutable forward graph arrays and the resolution index read-only. The operating system page cache can then share those physical pages across isolated PostgreSQL backends without copying the base graph into each backend’s Rust heap. This is not a replacement for PostgreSQL’s buffer pool: PostgreSQL remains responsible for table storage, WAL, MVCC, durability, and crash recovery, while pgGraph’s artifact is derived state that can be rebuilt from source tables.
  • Predictable and safe. Unbounded graph expansion can crash a database. pgGraph includes explicit circuit breakers: depth limits, visited-node tracking, frontier limits, pagination, and strict OOM/memory safeguards.

PostgreSQL Remains Authoritative

Your application data does not move. Source tables, constraints, indexes, ACLs, RLS, backups, and app writes remain 100% standard PostgreSQL concerns.

pgGraph is strictly derived state. You run the algorithms over internal node indexes, and the engine returns source table coordinates or hydrates the raw PostgreSQL rows on the fly. Build, sync, vacuum, and maintenance operations are fully visible and SQL-callable.

How pgGraph Compares

vs. Apache AGE: Execution Layer vs. Storage Layer

Apache AGE is a property graph database inside Postgres. It uses graph namespaces, vertex and edge tables, agtype, and openCypher.

pgGraph does not ask you to move your data or learn Cypher. You keep your existing schema and accelerate it with SQL functions like graph.search() and graph.shortest_path(). Use AGE for a dedicated property graph model; use pgGraph to add bounded, high-speed graph traversal to an existing relational schema.

vs. PostgreSQL 19 SQL/PGQ

SQL:2023 and PostgreSQL 19 introduce CREATE PROPERTY GRAPH, GRAPH_TABLE, and standard graph pattern matching backed by PostgreSQL’s planner and optimizer — the same engine that makes PostgreSQL’s relational queries strong.

pgGraph operates at a different layer. SQL/PGQ expresses graph patterns and lets the optimizer choose how to execute them. pgGraph precomputes CSR adjacency stores and rebuildable artifacts for workloads that repeatedly traverse the same topology with bounded depth, path limits, filters, tenants, and application pagination. The pgGraph 1.0 PostgreSQL 14–18 contract does not expose SQL/PGQ. PostgreSQL 19 integration is tracked separately on the public roadmap.

Community

pgGraph is built by Evokoa. Follow the project through the links at the top of this README.

License

Apache-2.0. See LICENSE.