pgrust: Postgres rewritten in Rust, graded by Postgres

4 months ago

Someone rewrote PostgreSQL from scratch in Rust, with AI. And the project says it already passes every test Postgres runs on itself.

Ask about this presentation

Chapters

  1. 0:00Slide 1
  2. 0:09A from-scratch rewrite you can run in your browser
  3. 0:23Slide 3
  4. 0:46Slide 4
  5. 1:01Slide 5
  6. 1:18Real Postgres SQL, real result
  7. 1:31Slide 7
  8. 1:58Three ways to run it today
  9. 2:13pgrust
Show transcript
  1. Someone rewrote PostgreSQL from scratch in Rust, with AI. And the project says it already passes every test Postgres runs on itself.

    Slide text
    GitHub Trending · Ep 07 · Jul 12, 2026
    pgrust: Postgres rewritten in Rust, graded by Postgres
    Passes every test Postgres runs on itself
    Rust AGPL-3.0 Postgres 18.3
  2. pgrust is a from-scratch reimplementation of Postgres in Rust. Not a fork of the C code, not a wrapper. And you can open a real psql session against it right in your browser. So should you trust an AI-assisted rewrite of a forty-year-old database?

    Slide text
    pgrust in-browser psql session: a real query returns a Postgres-shaped result table, with a header banner reading PostgreSQL regression suite 46,066 / 46,066 queries (100%)
    Real psql session on a Rust server compiled to WebAssembly
  3. Here's the clever part. Their answer: keep the behavior Postgres-shaped, and make Postgres's own regression suite the judge. Every change gets graded against Postgres's real expected output. Correct isn't a vibe, it's a diff against Postgres. They climbed from around sixty-seven percent to every one of Postgres's forty-six thousand regression queries. The project reports a hundred percent of the default suite. Malis and Seibel built it.

    Slide text
    Compatibility timeline: launch on Apr 20, about 67% of the Postgres regression suite on Apr 28, and now a project-reported 46,066 of 46,066 queries (100%)
    the project reports 100% of the default suite
  4. And it reaches below the SQL. pgrust uses the same on-disk format as Postgres. Point it at an existing Postgres eighteen point three data directory, your real tables and indexes, and it just boots and serves them. No dump, no restore, no migration.

  5. How much did they rewrite? Not just the query engine. The port spans the backend, the client interfaces, the procedural-language layer, contrib modules, even a libc shim for WebAssembly. That shim is why the browser demo works. Underneath sits vendored Postgres, the tests that act as the oracle.

  6. Back to that browser session, the real proof. Genuine Postgres SQL goes in, and the result comes straight back from a Rust server. Not a stub, not a recording. Prefer local? There's a pinned Docker image too.

    Slide text
    A live psql query: select 'pg' || 'rust' as name, 6 * 7 as answer, upper('postgres in rust') as shout, pi()::numeric(10,4) as pi; returns one row: pgrust, 42, POSTGRES IN RUST, 3.1416
    also: docker run malisper/pgrust:v0.1
  7. Now the honest part. pgrust is experimental: not production-ready, not performance-tuned, and most extensions plus PL/Python, Perl, and Tcl aren't compatible yet. And those big speed numbers, fifty percent faster on transactions, three hundred times faster on analytics? They're the maintainers' own figures for a version they haven't published, with no outside benchmark. Take them as a claim, not a result. The interest here is the method, not replacing your database this week.

    Slide text
    Experimental: know what it is before you download Not production-ready, not performance-tuned. Most extensions plus PL/Python, Perl, and Tcl aren't generally compatible yet.
    Connection model claim for a not-yet-published build: one thread per connection instead of one OS process per connection, with the maintainers' unpublished, unbenchmarked figures of about 50 percent faster on transactions and about 300 times faster on analytics, marked as an attributed claim
  8. So how do you try it? Easiest is the browser demo, zero install. Or docker run the pinned zero point one image, or build from source with cargo. It's AGPL-3.0, strong copyleft, so mind that for commercial use. The link's on screen.

    Slide text
    Browser pgrust.com, zero install
    Docker docker run malisper/pgrust:v0.1
    Source cargo build against vendored Postgres 18.3
    v0.1 AGPL-3.0 Rust
    github.com/malisper/pgrust
  9. So that's pgrust. A from-scratch Postgres rewrite that lets Postgres itself grade the work. Even at version zero point one, that's a genuinely clever idea, worth a star and a weekend poke. The link's on screen, and there's a new repo tomorrow.

    Slide text
    Postgres, rewritten in Rust, and it lets Postgres grade the work
    github.com/malisper/pgrust
    New repo tomorrow.

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