Software 44548 Published by

Former Heap CEO Malcolm Matis has announced pgrust, a complete Rust rewrite of PostgreSQL that successfully executes all 46,000 queries in the Postgres 18.3 regression suite without failure. The project leveraged eight parallel AI coding agents to rapidly generate over 450,000 lines of code, targeting architectural shifts like a thread-per-connection model and native disk compatibility. While early benchmarks claim dramatic performance leaps and a narrowing gap with ClickHouse, the author explicitly notes the current v0.1 release is neither production-ready nor performance-optimized. Despite lacking major extension support and facing legitimate community skepticism, pgrust marks a landmark experiment in using AI to modernize decades-old database infrastructure.





Malcolm Matis Announces pgrust, a Rust Rewrite of PostgreSQL That Passes 100% of Regression Tests

The project, built using 8 parallel AI coding agents, targets Postgres 18.3 with disk compatibility and ambitious performance claims.

pgrust has passed 100% of the Postgres 18.3 regression suite. The complete Rust rewrite, announced by author Malcolm Matis on July 9, 2026, executes over 46,000 regression queries without a single failure. A v0.1 release is available for testing now.

Matis isn't a new face in the database world. He's the former CEO of Heap and spent years managing petabyte-scale Postgres clusters. His blog has covered Postgres internals for years, and he's known for deep dives into SQL fractals and interpreter design. He started this project to tackle what he calls the "four horsemen" of Postgres pain: VACUUM outages, transaction ID wraparound, connection limits, and JSONB limitations.

Here's the wild part. The codebase was generated using AI coding agents. Matis ran eight paid Codex accounts, burning about $1,600 a month. A tool called Conductor coordinated 10 to 20 parallel sessions. By late April, the codebase had ballooned to over 450,000 lines of Rust. The regression tests passed not by slow human effort, but by aggressive multi-agent test-driven development.

Screenshot_from_2026_07_10_15_28_57

The Performance Claims

Matis is making bold claims for an unoptimized rewrite. The next unpublished version reportedly hits 50% faster transaction throughput on Percona-TPCC compared to Postgres. Analytical workloads? Roughly 300x faster. He also notes the project runs about 2x slower than ClickHouse on ClickBench, though he believes it can surpass it eventually. Regex operations are 10x faster thanks to Rust's engine versus Postgres's legacy PCRE.

Keep in mind that these numbers come from a version that hasn't been publicly released yet. The v0.1 target is disk-compatible with Postgres 18.3, meaning you can point it at an existing data directory. It's not production-ready. Extensions like pgvector or TimescaleDB aren't generally compatible yet. The author explicitly states the code isn't performance-optimized.

100% of the regression suite. That's 46,000 queries. Disk-compatible with Postgres 18.3. No migration required. Not production-ready. Yet.

Architecture Shifts and Risks

The biggest architectural change is the switch from Postgres's process-per-connection model to thread-per-connection. Rust's memory safety guarantees replace the need for process isolation. This should eliminate connection limits and improve parallel query performance. However, it introduces new risks. A crash in one connection could potentially affect others. Postgres's process model has protected against buggy extensions for decades. Matis acknowledges this challenge but hasn't detailed a full mitigation strategy.

Rust's memory safety is promising, though the thread model introduces risks that Postgres's process isolation has mitigated for decades. However, at the same time, the community is watching to see if Matis can actually deliver on those ClickHouse comparisons.

Community skepticism is already bubbling. On Hacker News, the announcement sparked 740 points and 620 comments. Concerns range from whether fsync was enabled during benchmarks to the feasibility of surpassing ClickHouse. ClickHouse is the result of hundreds of person-years of optimization. Ben Dicken, known for OrioleDB and rigorous database standards, saw the project and noted it "doesn't meet his bar quite yet."

It's a rather ambitious claim to beat ClickHouse within months of starting, though the columnar storage and batch execution optimizations in the unpublished version do give pgrust a fighting chance. Disk compatibility is a smart move for a rewrite of this magnitude. Being able to boot from an existing Postgres data directory lowers the barrier to testing. You can spin up pgrust alongside Postgres and run replication comparisons without migrating data. The GitHub repo is licensed under AGPL-3.0.

How to Try It

If you want to poke at the v0.1 release, Matis has provided a Docker container and a WebAssembly demo at pgrust.com.

docker run -d --name pgrust -e POSTGRES_PASSWORD=secret malisper/pgrust:v0.1
docker exec -it -e PGPASSWORD=secret pgrust psql -h 127.0.0.1 -U postgres

You can also build from source, though you'll need OpenSSL, ICU, libpq, and a Postgres 18 client. The repo currently has about 1,000 GitHub stars.

The roadmap includes multithreaded internals, a built-in connection pooler to replace PgBouncer, adaptive query planning, and storage experiments that might ditch VACUUM entirely. No date for a production release, though. For now, this is a fascinating proof-of-concept for what AI can achieve at scale, combined with genuine database engineering ambition.