pgrust: A Postgres Rewrite in Rust
pgrust is a Postgres rewrite in Rust that aims to behave exactly like Postgres 18.3 rather than invent a new database. It uses the real Postgres regression suite as its correctness oracle, is disk compatible with Postgres, and can boot straight from an existing Postgres 18.3 data directory. The maintainer built it with Rust plus AI-assisted programming, and it's an experiment, not a production database.
Reach for pgrust if you're curious how a Postgres-compatible engine looks when it's written in Rust, want to poke at server internals in a memory-safe language, or like following AI-assisted rewrites of large C codebases. Skip it if you need a database to run anything real today: the README itself says it's not production-ready and not performance-optimized, and the eye-catching '100% of regression tests, 50% faster, 300x on analytics' numbers describe a version that isn't published yet.
The problem it solves
Changing Postgres from the inside is hard. The codebase is decades of C, the process-per-connection model and vacuum-based storage are baked deep, and experimenting with server internals means fighting a lot of legacy before you can test an idea. pgrust exists to make that easier: keep the behavior Postgres-shaped and the real Postgres tests as the judge, but move to Rust so deeper changes to threading, storage, and query handling are safer to attempt.
What is it?
pgrust is a Postgres rewrite in Rust that targets compatibility with Postgres 18.3. It's disk compatible, so it can start from an existing Postgres 18.3 data directory, and it validates itself against the actual Postgres regression tests rather than a hand-written test set. The README says the currently available build matches Postgres's expected output across more than 46,000 regression queries. A newer, not-yet-published version is described as passing 100% of the suite with a thread-per-connection model, but that code isn't out. The project is AGPL-3.0 and openly experimental.
Why it's getting attention
A from-scratch Postgres rewrite that runs the real Postgres regression suite and can boot an existing 18.3 data directory is an unusually concrete take on the 'rewrite it in Rust' idea, and the maintainer is public about using AI-assisted programming to get there. The README's claim of an upcoming version that passes 100% of regression tests, runs 50% faster on transactions, and is roughly 300x faster on analytical workloads (its own benchmark puts it about 2x slower than ClickHouse on clickbench) is the kind of number that gets people looking, even though that build isn't shipped.
Key features
- ✓Disk compatible with Postgres 18.3 — boots from an existing Postgres data directory, no dump and restore
- ✓Uses the real Postgres regression suite as the correctness oracle; the available build matches expected output across 46,000+ queries
- ✓Written in Rust and built with AI-assisted programming, per the maintainer
- ✓Try-before-you-build paths: a WebAssembly demo at pgrust.com and a Docker image (malisper/pgrust:v0.1)
- ✓Ships the vendored Postgres 18.3 test files plus a scripts/run-regression runner so you can verify compatibility yourself
- ✓Roadmap items include multithreaded internals, built-in connection pooling, and no-vacuum storage experiments
Best use cases
- •Experimenting with Postgres server internals in a memory-safe language instead of C
- •Trying a Postgres-compatible engine against your own existing 18.3 data directory
- •Following how AI-assisted programming is applied to a large systems rewrite
- •Running the Postgres regression suite against an alternative implementation to see where it diverges
How to install / try
The quickest path is the Docker image — no build required: `docker run -d --name pgrust -e POSTGRES_PASSWORD=secret malisper/pgrust:v0.1` and then connect with the bundled `psql` client, or open the WebAssembly demo at pgrust.com with nothing installed at all. To build from source you'll need Rust plus system libraries (on macOS: `brew install icu4c openssl@3 libpq`; on Debian/Ubuntu: `build-essential pkg-config libicu-dev libssl-dev libldap2-dev libpam0g-dev postgresql-client-18`), then `PGRUST_PGSHAREDIR="$PWD/vendor/postgres-18.3/share" cargo build --release --locked --bin postgres`.
How to use
After building, initialise a data directory with `target/release/postgres --initdb -D /tmp/pgrust-data -L "$PWD/vendor/postgres-18.3/share" --no-locale --encoding UTF8 -U postgres`, start the server binary, then connect with a Postgres 18 `psql`: `psql -h /tmp -p 5432 -U postgres -d postgres`. To check compatibility yourself, run the vendored regression tests with `PGRUST_BIN="$PWD/target/release/postgres" scripts/run-regression` (it needs a Postgres 18 `psql` on PATH). pgrust can also boot directly from an existing Postgres 18.3 data directory.
Strengths
- ✓Uses the actual Postgres regression suite as the oracle, so 'compatible' means matching real Postgres output, not a self-graded test set
- ✓Disk compatibility means you can point it at an existing Postgres 18.3 data directory without a dump-and-restore
- ✓You can try it in a browser (WASM) or via one Docker command before committing to a source build
- ✓Rust brings memory safety to a class of code that in C has produced a long history of subtle bugs
Limitations & risks
- △The README states plainly that pgrust is not production-ready and not performance-optimized yet
- △The headline 100%-pass, 50%-faster, and ~300x-analytics figures describe an unpublished version — the code you can actually run today matches 46,000+ regression queries, not the full suite
- △Existing extensions and procedural languages such as PL/Python, PL/Perl, and PL/Tcl aren't generally compatible yet
- △AGPL-3.0 is strong copyleft that many companies avoid for server-side software, since network use can trigger source-sharing obligations
- △An AI-assisted rewrite of a database is inherently high-risk for subtle correctness bugs that a regression suite won't always catch
Alternatives
Who should try it — and who should skip
pgrust is for database-curious engineers, Rust systems programmers, and people who want to watch an AI-assisted rewrite of Postgres unfold — anyone who values poking at internals over running a workload. If you need a database for anything real, or you can't take on AGPL-3.0, this isn't it yet; run stock PostgreSQL and follow pgrust's updates instead.
Frequently asked questions
pgrust is a Postgres rewrite in Rust that targets compatibility with Postgres 18.3. It's disk compatible with Postgres, can boot from an existing 18.3 data directory, and checks itself against the real Postgres regression tests. The maintainer built it with Rust plus AI-assisted programming.
No. The README says explicitly that pgrust is not production-ready and not performance-optimized yet. It's an experiment for exploring Postgres internals, not a drop-in database for real workloads.
Not in the version you can run today. The README says the currently available build matches expected output across more than 46,000 regression queries, while a newer, not-yet-published version is described as passing 100% of the suite. Treat the 100% figure as a claim about upcoming, unreleased code.
The README says pgrust is disk compatible with Postgres and can boot from an existing Postgres 18.3 data directory, so in principle you can point it at data created by real Postgres 18.3 — though given the not-production-ready status, only do this with copies you don't mind losing.
pgrust is licensed under AGPL-3.0, a strong copyleft license. That matters for server software because offering it over a network can trigger obligations to share your source, which is why some companies avoid AGPL dependencies.