Postgres, Rewritten in Rust by AI — and Passing 100% of the Regression Tests

There is a interesting project called pgrust which used AI coding agents to rewrite PostgreSQL in Rust — and the latest in-development version reportedly passes 100% of Postgres’s own regression test suite.

It’s an impressive technical stunt that has also set off one of the liveliest debates on Lobsters in a while: not about whether the code works, but about what “building software” even means anymore.

What Was Actually Built

pgrust is an experimental, AI-assisted fork that treats real Postgres behavior as the target and the real Postgres tests as the oracle — keeping things “Postgres-shaped” while using Rust to explore deeper internal changes. Per the author’s own notes:

A new, not-yet-published version passes 100% of the Postgres regression suite, uses a thread-per-connection model (instead of process-per-connection), is ~50% faster on transactional workloads, and ~300x faster on analytical workloads — roughly 2x slower than ClickHouse on ClickBench, with room to improve.

The author is candid about the method: “a lot of dumb code makes its way through, and that’s okay.” The priority is getting something that works, then fixing problems as they surface, trusting the agent to do the bulk of the writing. He also admits he was “no longer reading most of the code.”

Two Big Caveats

ConcernDetail
Licensepgrust ships under AGPLv3 — far more restrictive than Postgres’s permissive license. Many companies blanket-ban AGPL, so it’s not a drop-in replacement in a lot of environments. (Ironic, several noted, for LLM-generated code.)
MaturityThe 100%-passing version is still unreleased. Test coverage of Postgres itself is debated, so “passes the tests” isn’t the same as “battle-tested in production.”

The Real Debate: What Does “Build” Mean?

The comment thread quickly moved past the database and into philosophy. The author said he “just like[s] building cool stuff” and compared driving LLMs to his love of Lisp — “programming with LLMs, you are building a machine that builds programs.” Critics pushed back hard:

  • “You’re a user, not a maker.” If you didn’t make the LLM, are you writing a program-generator or just using someone else’s? (Countered with: did you write your compiler in raw binary either?)
  • The carpenter analogies flew — hammers vs. apprentices vs. 3D-printers — until someone begged for a “sticky thread with a canonical AI-analogy exchange” to save everyone the energy.
  • The community angle. The most-upvoted sentiment wasn’t anti-AI, it was this: “What makes or breaks a project like Postgres is the community” — the ~121 named contributors and thousands of others. A test suite is the sausage; the decades of shared human expertise are the factory. By that measure, pgrust is “a fun experiment, nothing more.”

One commenter offered the sharpest framing: LLMs have split developers into those who love the result of coding and those who love the craft — two groups that used to be conflated because software was hard enough to force everyone to master the craft.

The Takeaway

pgrust is a genuine “unimaginable two years ago” moment: AI agents produced ~1M lines of Rust that clears Postgres’s regression tests and, in early benchmarks, runs faster. But passing tests isn’t the same as earning trust, maintainability, or a community — and the AGPL license alone rules it out for many. The most interesting output here may not be the database at all, but the mirror it holds up to how developers now define their own work.

Related Reading

Avatar photo
David Cao

David is a Cloud & DevOps Enthusiast. He has years of experience as a Linux engineer. He had working experience in AMD, EMC. He likes Linux, Python, bash, and more. He is a technical blogger and a Software Engineer. He enjoys sharing his learning and contributing to open-source.

Articles: 685

Leave a Reply

Your email address will not be published. Required fields are marked *