Skip to content

malisper/pgrust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3,863 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgrust

PostgreSQL, rewritten from scratch in Rust.

Try it in your browser → pgrust.com


Status: V1 / experimental

This is not production-ready. pgrust is now passing about 96% of PostgreSQL's regression suite. Core systems exist, psql connects, and the browser demo runs the same engine compiled to WebAssembly. Many features are still missing, performance is uneven, and correctness work is ongoing.

Original launch write-up.

Latest update: The four horsemen behind thousands of Postgres outages.

Previous update: 67% Postgres compatibility and accelerating.

Why?

PostgreSQL has been in development for 40 years. But some architectural decisions from 80s keep showing up as operational pain:

  • Single-threaded per connection — one OS process per connection. Limited parallelism in queries.
  • Manual tuning — 350+ parameters. PGTune exists because Postgres won't tune itself.
  • Vacuum — Has maybe caused thousands of outages, potentially much more.

pgrust is an experiment: what does Postgres look like if you start from scratch with modern primitives?

What works

  • Query planner
  • Buffer cache
  • Storage engine
  • B-tree indexes
  • Wire protocol compatibility (psql connects)
  • JSON and JSONB
  • Window functions
  • Foreign keys
  • EXPLAIN / EXPLAIN ANALYZE
  • Regex support
  • PL/pgSQL pieces
  • Basic SQL: SELECT / INSERT / UPDATE / DELETE / CREATE TABLE / CREATE INDEX / transactions / aggregates / joins
  • ~96% of PostgreSQL regression tests match expected output

Current snapshot

The public main branch moves forward with intentionally published updates. The 96% compatibility snapshot is tagged as compat-96pct-20260507, and the previous 67% snapshot remains tagged as compat-67pct-20260427.

Roadmap

  • Push the remaining PostgreSQL compatibility gaps toward 100%.
  • Stability and bug bashing so pgrust can move from experimental to trustworthy.
  • Explore architectural fixes for common Postgres outage sources: 64-bit transaction IDs, VACUUM alternatives, better connection/query parallelism, adaptive planning, and JSON statistics/compression.

Quick start

In-browser (no install)

pgrust.com runs pgrust compiled to WebAssembly in your browser, with examples for window functions, JSONB, foreign keys, EXPLAIN ANALYZE, regex, and a recursive-CTE Lisp interpreter.

Native (clone and run)

git clone <https://github.com/malisper/pgrust.git>
cd pgrust
cargo run --release --bin pgrust_server -- --port 54321

Then from another terminal:

# If you have psql installed
psql -h localhost -p 54321 -d postgres
# If you don't have psql installed
docker run -it --rm postgres:18 psql -h host.docker.internal -p 54321 -U postgres

Docker

docker run --rm --name pgrust -p 54321:5432 malisper/pgrust:nightly
# If you have psql installed
psql -h localhost -p 54321 -d postgres
# If you don't have psql installed
docker run -it --rm postgres:18 psql -h host.docker.internal -p 54321 -U postgres

Stay updated

Contributing

Early stage. Not accepting code PRs yet, the codebase is still evolving too fast for external contributions to be stable. Issues and feedback are very welcome, and contributions will open once the architecture stabilizes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors