TopGit
GitHub Repo Review

pgrust: A Postgres Rewrite in Rust

malisper/pgrust
PTopGit review image for malisper/pgrust
Review by Topgit.dev for malisper/pgrust, with GitHub repository stats and README context.
Quick verdict

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.

Stars
โ˜… 5.1k
Forks
โ‘‚ 191
Contributors
๐Ÿ‘ฅ 3
Language
Rust
License
AGPL-3.0
Topic
Data
Updated
Sep 2026

A Rust Engine That Boots Your Postgres 18.3 Data

pgrust is a Rust rewrite of Postgres targeting compatibility with Postgres 18.3. It's disk compatible, able to start from an existing Postgres 18.3 data directory, and validates against Postgres's own regression tests โ€” the current build matches expected output across 46,000+ queries. A newer, unpublished version reportedly passes 100% of the suite with a thread-per-connection model. It's AGPL-3.0 and openly experimental.

Rewriting Postgres Means Fighting Decades of C

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.

46,000+ Regression Queries as the Correctness Oracle

  • โœ“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

Big Numbers From a Version That Isn't Published Yet

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.

How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history โ†—

Booting From an Existing Data Directory

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.

A Docker Image or a WASM Demo, No Build Needed

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

Poking at Server Internals in a Memory-Safe Language

  • โ€ข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

Compatibility Measured Against Real Postgres Output

  • โœ“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

Not Production-Ready, and AGPL-3.0 Copyleft

  • โ–ณ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

PostgreSQL, Neon, CockroachDB, and Materialize

PostgreSQL โ€” the original C implementation pgrust mirrors, and the reference for every compatibility claimNeon โ€” serverless Postgres with a Rust-based storage layer that separates compute and storageCockroachDB โ€” a distributed, Postgres wire-compatible SQL database (written in Go)Materialize โ€” a Rust database focused on streaming and incremental analytical queriesClickHouse โ€” the analytical database the README benchmarks pgrust's future version against โ†—

For the Database-Curious, Not for Production Data

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.

pgrust FAQ

What is pgrust?

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.

Is pgrust production-ready?

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.

Does pgrust really pass 100% of the Postgres regression tests?

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.

Can pgrust use my existing Postgres data?

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.

What license is pgrust under?

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.

Related repositories

Source & attribution

Based on the official malisper/pgrust GitHub repository, including its README and project metadata.

GitHub data ยท last synced Jul 11, 2026Reviewed by Henry
โ† Back to TopGit

Want a second opinion on pgrust?

Ask an AI that can read this page โ€” one click and you get its take on pgrust.

GitHub