Open-source project
malisper/pgrust avatar
malisper/pgrust

pgrust: a Rust rewrite of Postgres with its own JIT compiled query engine

Postgres rewritten in Rust, now faster than Postgres and Clickhouse

5,810 stars227 forksRustAGPL-3.0

At a glance

What is it?
pgrust reimplements Postgres in Rust with a vectorized push-based, JIT compiled query engine, and stays wire and SQL dialect compatible with Postgres.
Who is it for?
pgrust is worth adopting only for evaluation: a non-critical environment and a workload you can replay, which is exactly the posture the v0.3 release note describes. Do not adopt it for production data while it is at v0.4-beta.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 20 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • malisper/pgrust5,810 ★ · +689
Star history
Repository2026-09-232026-11-15
malisper/pgrust5.1k5.8k

689 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The problem pgrust attacks: Postgres outages, not Postgres syntax

pgrust is not trying to replace the SQL dialect. It is trying to replace the engine underneath it. The README frames the motivation around "the four horsemen behind thousands of Postgres outages," and two of the four named in the project's own writing are addressed directly by components pgrust adds: a query scheduler designed to keep any individual query from taking down the database, and an automatic memory manager that gives pgrust control of what happens when memory runs low, greatly reducing the chance of the whole database being taken down by the OS OOM killer.

The intended audience is narrow. This is for engineers who already run Postgres, understand its operational failure modes, and want to see what the same system looks like when the executor, the concurrency model and the memory policy are redesigned in Rust. The v0.3 release title frames it as something to try on real world workloads in non-critical environments.

How pgrust is put together: a workspace of Postgres subsystems in Rust

The repository is a Cargo workspace, and the layout mirrors Postgres internals rather than hiding them. `crates/backend/replication/logical/worker`, `crates/backend/backup/basebackup`, `crates/backend/utils/adt/trigfuncs`, `crates/common/hashfn`: these are Postgres source directories translated into crate paths. That structure is the clearest evidence of the project's method. Each line is Rust, written to match the behavior of the C implementation, so the port is deliberately conservative at the boundary and inventive only in specific places.

The inventive places are listed in the README: a vectorized push-based, JIT compiled executor; a thread based concurrency model instead of Postgres's process-per-connection model; the query scheduler; and the automatic memory manager. The README links a post titled How AI Changes the Economics of JIT Compilers, and release builds cover any x86-64 CPU, any 64-bit Arm CPU and macOS, with tuned builds for AMD Zen 3 and Neoverse-V2 (AWS Graviton4, NVIDIA Grace).

The repository carries a regress/ directory and a postgres-reference.lock file at the top level.

Installing pgrust and running a first query

The project points readers at https://pgrust.com, a full pgrust server compiled to WebAssembly, to try it in a browser. On your own machine, the README offers self-contained release tarballs from https://pgrust.com/downloads/v0.4-beta/ and a Docker image, `malisper/pgrust`, described as a drop-in replacement for the official `postgres` image.

bash
docker run -d --name pgrust -e POSTGRES_PASSWORD=secret -p 5432:5432 malisper/pgrust:v0.4-beta

For a real workload, the posture is set by the v0.3 release, titled "Try us on real world workloads in non-critical environments." Because pgrust is wire compatible, the practical first use is to point an existing client at it and replay read-only traffic, not to migrate writes.

The benchmark numbers, and the two caveats the README attaches to them

The repository description claims pgrust is now faster than Postgres and Clickhouse. The harnesses live in `benchmarks/`.

The README notes the Linux builds are profile-guided optimized and offers tuned builds for AMD Zen 3 and for Neoverse-V2 (AWS Graviton4, NVIDIA Grace); when in doubt, it says, take the generic build.

What pgrust cannot do: no extension ABI, no PL/Python, and a bug backlog

The current release is v0.4-beta, and the README notes that a data volume written by v0.3 holding columnar tables needs a dump and restore.

pgrust vs PostgreSQL, ClickHouse and Turso: different bets

The comparison the project invites is with PostgreSQL 18.6, because pgrust is wire and dialect compatible with it. The difference in approach is the executor and the process model. Postgres uses a process-per-connection model and a pull-based executor; pgrust uses threads and a vectorized push-based executor with JIT compilation, plus a scheduler and an OOM killer that change failure behavior under load. The trade is that you inherit Postgres's interface but not its decade of operational hardening.

Against ClickHouse, the difference is category. ClickHouse is an analytical database that was never trying to be a drop-in Postgres; pgrust has columnar tables while keeping the Postgres dialect. If your team already writes Postgres SQL and wants analytical speed without a second dialect, that is the bet pgrust makes. If you are happy maintaining a separate analytical store, ClickHouse is the more established answer and pgrust's claimed speed edge is not a reason to move.

Licence and the cost of tracking a fast-moving engine

pgrust is AGPL-3.0, and the repository carries a separate `NOTICE` file alongside `LICENSE`. That is a stronger copyleft than PostgreSQL's permissive licence, and it matters if you plan to embed pgrust in a service or modify it. This is a description of the licence identifier, not legal advice; if your use involves distribution or a hosted offering, have counsel read the AGPL and the NOTICE before you build on it.

Upgrade cost is real. The last push was on 2026-10-26, and the release cadence is fast: v0.3 shipped on 2026-09-15, v0.3.1 on 2026-10-19 and v0.4-beta on 2026-10-22. An engine at this stage changes behavior between releases by design. The README notes that a v0.3 data volume holding columnar tables needs a dump and restore for v0.4-beta. Budget for re-running your own workload on every release rather than assuming a smooth in-place upgrade.

Editorial conclusion

pgrust is worth adopting only for evaluation: a non-critical environment and a workload you can replay, which is exactly the posture the v0.3 release note describes. Do not adopt it for production data while it is at v0.4-beta. Verify first that your schema and queries run against it, then check the harnesses in `benchmarks/` to see what the project actually gates on before you trust a number.

Frequently asked questions

What is pgrust?

pgrust is a re-implementation of Postgres in Rust, wire compatible and SQL dialect compatible with Postgres. It has a vectorized push-based, JIT compiled query engine, a thread based concurrency model, a query scheduler and an automatic memory manager.

Can Rust be used with PostgreSQL?

pgrust is a full rewrite of Postgres in Rust rather than an extension or client library, and the README says every line is Rust, written to match the behavior of the C implementation.

Is pgrust production ready?

No. The current release is v0.4-beta. The v0.3 release note frames the target as real world workloads in non-critical environments.

Does pgrust support PostgreSQL extensions?

Check the README and the v0.4-beta release post before relying on any extension: the quickstart describes only pgrust's own bin/postgres, bin/initdb and bin/psql plus the share files they read.

How does pgrust get its performance?

The README lists a vectorized push-based, JIT compiled executor, a thread based concurrency model, a query scheduler and an automatic memory manager. The Linux release builds are profile-guided optimized, with tuned builds for AMD Zen 3 and Neoverse-V2.

Official sources

  1. License: AGPL-3.0
  2. malisper/pgrust on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/malisper-pgrust.svg)](https://hysenlabs.com/projects/malisper-pgrust)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/malisper-pgrust.svg)](https://hysenlabs.com/projects/malisper-pgrust)

Was this useful?