Postgres rewritten in Rust by AI. It passes 46,066 tests.

4 months ago

Someone rewrote PostgreSQL from the source into Rust, and it now matches Postgres on every one of forty-six thousand regression queries.

Ask about this presentation

Chapters

  1. 0:00Slide 1
  2. 0:09A from-source rewrite that boots real Postgres data
  3. 0:21It matches Postgres on all 46,066 regression queries
  4. 0:33Built by AI agents, crate by crate
  5. 0:49Passing tests isn't the same as reliability
  6. 0:59You can run it today, in the browser or Docker
  7. 1:1046,066 tests say the behavior matches
Show transcript
  1. Someone rewrote PostgreSQL from the source into Rust, and it now matches Postgres on every one of forty-six thousand regression queries.

    Slide text
    Postgres rewritten in Rust by AI. It passes 46,066 tests.
    AI-assisted, from the source, targeting Postgres 18.3
    Rust rewrite PostgreSQL github.com/malisper
  2. It's a rewrite of Postgres eighteen point three into Rust. And it's disk compatible. It reads Postgres's real data files, so it can boot up on an existing eighteen point three database, no dump and reload.

    Slide text
    The pgrust GitHub README hero: the badges Postgres 18.3, regression queries 46k+, and AGPL-3.0, plus the disk-compatible line
    Reads Postgres's own data files, no dump-and-reload
  3. Forty-six thousand and sixty-six regression queries. It matches Postgres on all of them. A hundred percent of the default suite. That means the query output matches, one for one.

    Slide text
    46,066 / 46,066
    regression queries · 100%
    Every query in Postgres's default regression suite
  4. Here's how. A tool mechanically translates the Postgres source into Rust, which splits it into more than a thousand crates. Then AI agents rewrote them one at a time, with Postgres's own tests as the judge. Over seven thousand commits, in under a month.

    Slide text
    A translator turns Postgres's C source into a Rust workspace of 1,464 crates
    7,102
    commits on main
    27 days · about 263 per day · Jun 12 → Jul 9, 2026
    1,464-crate workspace
  5. Not everyone is sold. One engineer made the case against. Reliability, they argue, comes from years of running in production, from real-world scars, not from passing a test suite.

    Slide text
    "the things that make software like Postgres and SQLite reliable are not mostly the test, but the real world production scars."
    — a common objection
  6. You can try it right now, in the browser, or pull the Docker image. It's AGPL licensed, a change from Postgres's permissive license, and the author is clear it's not production-ready yet.

    Slide text
    The live in-browser WASM psql session running a query and rendering a real result table, with the 46,066/46,066 regression banner in frame
    PostgreSQL License → AGPL-3.0
    The author says it is not production-ready yet
  7. Forty-six thousand tests say the behavior matches. Whether an AI-built database earns the scars of a real one is the next question.

    Slide text
    46,066 / 46,066 · 100%
    github.com/malisper/pgrust pgrust.com

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York