pgrust: Postgres rewritten in Rust, graded by Postgres

2 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

Ask about this presentation

Answers are generated from 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

Slide 1

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

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

A from-scratch rewrite you can run in your browser

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

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 3

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

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 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.

Slide 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.

Real Postgres SQL, real result

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

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 7

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

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.

Three ways to run it today

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

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.

pgrust

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

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.