What is Pgrust?
Pgrust is a drop-in replacement for PostgreSQL at the protocol and SQL level. Any application, client library, or driver that works with Postgres works with Pgrust without modification. Under the hood, everything from the storage engine to the query executor has been rewritten from scratch in Rust. Key properties at a glance:- 100% wire-compatible with PostgreSQL 18.3 - use any Postgres client, driver, or tool
- SQL-dialect-compatible - the same queries that run on Postgres run on Pgrust
- Passes all 46,066 tests in PostgreSQL’s own regression suite
- Measurably faster than both PostgreSQL and ClickHouse on standard benchmarks
Key Capabilities
Columnar Storage
pgrcolumnar is built directly into Pgrust, providing columnar storage for analytical workloads. No extension installation required — just create a columnar table and start querying.
Vectorized JIT Executor
Pgrust uses a vectorized, push-based, JIT-compiled query executor with approximately 5 µs compile time, dramatically reducing per-query overhead for both OLTP and analytics.
Thread-Based Concurrency
Rather than spawning a new OS process per connection (as PostgreSQL does), Pgrust uses a thread-based model. This reduces memory overhead and improves resource sharing across concurrent connections.
Built-in Query Scheduler
Pgrust includes an integrated query scheduler that manages workload prioritization and resource allocation, alongside a built-in OOM killer that terminates runaway queries before they crash the server.
Pipelined fsync
Pgrust’s pipelined fsync implementation delivers a 30–50× speedup on update-contended queries by optimizing the order of disk flush operations.
Docker Drop-In
The
malisper/pgrust:v0.2 image is a drop-in replacement for the official postgres Docker image. It accepts the same environment variables and supports both amd64 and arm64 architectures.Performance Highlights
Pgrust is benchmarked against industry-standard suites. These results reflect v0.2 on identical hardware.ClickBench
Pgrust with pgrcolumnar columnar storage is 18.5% faster than ClickHouse across the ClickBench suite. ClickHouse is one of the fastest dedicated analytical databases available, making this a meaningful result for a system that is simultaneously fully PostgreSQL-compatible.sysbench OLTP Read-Only
On the sysbench OLTP read-only benchmark at 300 GB scale, Pgrust delivers 30% higher throughput than PostgreSQL 18.3. This improvement comes from the combination of the thread-based concurrency model, the JIT executor, and reduced IPC overhead.Both benchmarks were run on identical hardware under controlled conditions. Your results will vary depending on workload shape, hardware, and configuration. Always benchmark against your own workload before drawing conclusions.
Try It Now
Quickstart
Install and run Pgrust on macOS or Linux in under 5 minutes using the pre-built binary.
Docker
Run Pgrust as a Docker container — a drop-in replacement for the official
postgres image.Browser Demo
Try Pgrust instantly in your browser — no installation required. Full Pgrust compiled to WebAssembly.