Edited by humans. Written by AI. How our editing works
All articles

pgrust: A Full Postgres Rewrite in Rust, Tested

pgrust passes all 46,066 official Postgres regression tests and boots real data directories. Here's what that means—and what it doesn't.

Bob Reynolds

Written by AI. Bob Reynolds

July 18, 20266 min read
Share:
Man with surprised expression next to text "POSTGRES REWRITE" and database-to-Rust conversion icon with 100% checkmark

Photo: AI. Lila Bencher

Postgres has roughly a million lines of C and nearly four decades of accumulated architecture. Someone decided to rewrite all of it in Rust. Then, somehow, the result passed all 46,066 official PostgreSQL regression queries.

That's the headline. Now let's talk about what it actually means.

The project is called pgrust, built by Michael Malis and Jason Seebol. The Better Stack team ran it through its paces—standard Docker image, unmodified psql client, real SQL queries, EXPLAIN output, 100,000-row inserts—and from the outside, as they put it, it was "completely indistinguishable from Postgres. Same client, same SQL, same output." The wire protocol is real. The query planner is real. The storage engine reads an existing Postgres 18.3 data directory without modification. Whatever pgrust is, it's not a demo or a toy. It's a functioning database server written in a different language.

That's genuinely unusual. The phrase "Postgres compatible" appears on a lot of project pages and means almost nothing—anywhere from "we support SELECT and INSERT" to "we implement most of the SQL standard." CockroachDB calls itself Postgres compatible. Yugabyte calls itself Postgres compatible. Both are distributed systems whose primary design goals sit elsewhere. pgrust takes actual Postgres behavior as its specification and uses the official regression test suite as its judge. Passing 46,066 of those queries is a measurable claim, not a marketing one.

So: respect where respect is due.


What pgrust Is Actually Trying to Do

Understanding why pgrust exists requires a quick look at what Postgres's architecture costs you. Every client connection in Postgres gets its own operating system process. That isolation is a feature—if one process crashes, the others keep running. But it comes with overhead: memory per connection, constant pressure toward external connection poolers like PgBouncer, and difficulty sharing state efficiently across parallel operations.

Rust's memory safety model makes a different trade-off possible. The unpublished development version of pgrust reportedly replaces the process-per-connection model with a thread-per-connection model. Threads inside the same process share memory more easily and carry less per-connection overhead. The Better Stack coverage flags the honest trade-off here: "Separate processes also create useful walls between connections. If one process fails, that separation can help contain the damage. With threads, one unsafe extension or memory bug could affect more of the server."

Thread-per-connection is not a novel idea—MySQL uses it, and there's a long debate in database engineering about which model serves better under which workload. What's novel is attempting it inside something that behaves, at the protocol and SQL level, exactly like Postgres.

The performance claims attached to this architectural shift are substantial. The developers report roughly 50% better performance on transactional workloads and approximately 300 times Postgres performance on analytical workloads. Those numbers are striking enough to warrant the obvious question: where's the code?

It's not available for inspection yet. The thread-per-connection version is unpublished. The current release, the one that passes the regression tests, is not heavily optimized and is not where those benchmark figures come from. Better Stack puts it plainly: "We don't have real stats just yet. That does not automatically mean the numbers are false, though. It just means we should treat them as promising claims, not settled facts."

That's the right frame. The 300x figure in particular should be held loosely until it can be reproduced independently. Analytical workload performance is highly sensitive to benchmark design—what data, what queries, what hardware, what configuration. A 300x improvement that evaporates under realistic conditions is a marketing number; one that holds up under scrutiny is a technical achievement. We don't know which this is yet.


The AI Angle Is the More Interesting Story

Buried underneath the benchmarks is a question that matters more in the long run: how did two developers rewrite a million-line codebase at all?

The answer is coding agents. Malis and Seebol used AI tools heavily throughout the rewrite. The published version of pgrust deliberately mirrors the original Postgres structure in many places—the architectural innovation is being saved for later. The AI was used to generate code quickly enough that a project of this scale became tractable for a small team.

That shifts the frame entirely. The question isn't just "can Rust make Postgres faster?" It's closer to what Better Stack articulates: "Can AI make a rewrite this large affordable enough that developers can actually rethink architecture underneath things?" If the answer is yes, then pgrust—regardless of whether it ever runs in production—is evidence that the cost curve for large infrastructure experiments has changed. Projects that previously required years of engineering time and significant organizational commitment might now be exploratory. That's a meaningful shift in what's possible.

There's a reasonable skepticism here too. Generating hundreds of thousands of lines of code quickly is not the same as generating correct, maintainable, production-hardened code. The Hacker News discussion around pgrust ran to hundreds of comments and points, with a split between people impressed by the regression test achievement and people pointing out that tests don't replicate years of crash recovery, replication edge cases, and the kind of bugs that only surface after a database has been running continuously for months. Both reactions are correct. They're addressing different questions.


The Extension Problem

One gap worth naming explicitly: extensions. Postgres's extension ecosystem—PostGIS, pgvector, TimescaleDB, and hundreds of others—is a significant part of why organizations choose Postgres in the first place. Extensions hook into Postgres internals. A complete rewrite doesn't inherit that ecosystem automatically; it has to rebuild compatibility for each one, or provide a shim layer, or tell users to go without.

pgrust hasn't solved this. The Better Stack coverage notes that extension compatibility remains a major unfinished area. For many production deployments, this is the actual blocker, not benchmark numbers or thread models. A database that runs 50% faster but can't run PostGIS is a harder sell to the teams that need PostGIS.

This is solvable in principle. It's not solved yet.


Where This Sits Right Now

pgrust is an experimental project that has cleared a meaningful technical bar. It is not production software, and its developers say so. You should not migrate your production database to it. The extension ecosystem is incomplete. The most interesting architectural version—the one with thread-per-connection and the extraordinary performance claims—hasn't shipped publicly.

What it is: a demonstration that the official Postgres regression suite can serve as a specification rigorous enough to build against, that AI tooling has changed the labor economics of large rewrites, and that there's genuine engineering interest in questioning assumptions baked into Postgres's architecture in the 1990s.

Whether pgrust specifically becomes important is an open question. What seems harder to dismiss is the possibility it represents: that the era of "we can't afford to rethink this" may be ending—one benchmark at a time, once someone actually publishes the code.


Bob Reynolds is Senior Technology Correspondent at BuzzRAG.

From the BuzzRAG Team

AI Moves Fast. We Keep You Current.

Framework breakdowns, tool comparisons, and AI coding insights — distilled from the best tech YouTube creators. Free, weekly.

Weekly digestNo spamUnsubscribe anytime

More Like This

Orange pixelated character floating above a mountain landscape with "multica" logo on black banner

Multica Wants to Turn AI Agents Into Project Managers

An open-source tool promises kanban boards for Claude and other coding agents. But do developers actually want their AI assistants managed like tasks?

Bob Reynolds·3 months ago·6 min read
Bold yellow "GOODBYE CONTAINERS" text with "NEW" label and orange hexagonal logo against black background

Cloudflare's Dynamic Workers Promise Speed. At What Cost?

Cloudflare's new Dynamic Workers can spawn a million sandboxes per second. The catch? They only run JavaScript—and they won't stay free forever.

Bob Reynolds·4 months ago·6 min read
Retro arcade-style graphic with "CLAUDE LOOPS NOT YET" text, orange pixelated creature, and red virus icon with X through…

Claude's Loop Feature Isn't What the Hype Suggests

Anthropic's new loop skill for Claude Code has developers excited, but they're misunderstanding its purpose. Here's what it actually does.

Bob Reynolds·4 months ago·5 min read
Animated character with wide eyes and concerned expression next to bold yellow text reading "NO MORE RALPH" on black…

Decoding the Ralph Wiggum Loop's Impact on AI

Explore Ralph Wiggum Loop's AI impact, its missteps, and potential for optimizing task management.

Bob Reynolds·6 months ago·3 min read
Man wearing headphones with hand to chin, PostgreSQL and database icons displayed, "PostgreSQL Crash Course Basics of…

PostgreSQL Explained for the Rest of Us

PostgreSQL powers much of the internet's data infrastructure. A new beginner tutorial makes the case that understanding it isn't just for coders anymore.

Bob Reynolds·1 month ago·7 min read
White text reading "Huge Update" above a yellow banner with "PG_DURABLE" alongside a blue elephant logo on black background

pg_durable Brings Crash-Proof Workflows to PostgreSQL

Microsoft's pg_durable extension lets PostgreSQL handle durable, crash-proof workflows natively—no Temporal, no cron, no external queue. Here's what that actually means.

Dev Kapoor·1 week ago·6 min read
Woman in office setting with CSV to PDF conversion icons and "NO RAG?" text in yellow, discussing AI pipeline alternatives

When Simple Beats Complex: Claude Projects vs. RAG Pipelines

A tech consultant tested Claude Projects against traditional RAG systems. The results raise uncomfortable questions about enterprise infrastructure.

Bob Reynolds·3 months ago·5 min read
Bold orange and white "CLAUDE DESIGN" text overlays a dark interface screenshot showing grid analytics and UI design tools…

Anthropic's Claude Design: The Latest Bid to Automate Creativity

Anthropic launches Claude Design, an AI tool that generates visual assets from text prompts. But can conversation replace craft in design work?

Bob Reynolds·3 months ago·5 min read

RAG·vector embedding

2026-07-18
1,562 tokens1536-dimmodel text-embedding-3-small

This article is indexed as a 1536-dimensional vector for semantic retrieval. Crawlers that parse structured data can use the embedded payload below.