Show HN: pg_stream – incremental view maintenance for PostgreSQL in Rust(github.com)
github.com
Show HN: pg_stream – incremental view maintenance for PostgreSQL in Rust
https://github.com/grove/pg-stream
3 comments
This sounds cool, adding to my list of things to try out.
One note, this shouldn't be confused with https://github.com/xataio/pgstream which does logical replication/CDC with DDL changes.
One note, this shouldn't be confused with https://github.com/xataio/pgstream which does logical replication/CDC with DDL changes.
We've renamed the project to pg_trickle: https://github.com/grove/pg-trickle
Thanks. Naming is hard, but we'll look into it.
You define a stream table (a SQL query + a freshness bound) and the extension derives a delta query that processes only changed rows on each refresh cycle:
One INSERT into a million-row table → pg_stream touches one row's worth of computation. Query it like any regular table.
How it works: - Trigger-based CDC captures row changes into buffer tables inside the same transaction (no wal_level = logical required) - A background worker walks a topological DAG of stream tables and fires refreshes in dependency order - The DVM engine (differential view maintenance, DBSP framework) rewrites your SQL into a delta query at definition time — JOINs, GROUP BY, CTEs, window functions, LATERAL, subqueries all supported - Stream tables can depend on other stream tables; a change to a base table cascades automatically through the entire chain
Written in Rust using pgrx. 1,300+ tests (unit + integration + E2E). dbt macro package included.
GitHub: https://github.com/grove/pg-stream Docs: https://grove.github.io/pg-stream