{"name":"pgrust: Postgres Rewritten in Rust, Passing All Regression Tests","description":"pgrust is an ambitious project rewriting Postgres in Rust, now successfully passing 100% of Postgres regression tests. It aims for compatibility with Postgres 18.3 and offers significant performance improvements, especially for transaction and analytical workloads. This project focuses on making internal changes easier while maintaining Postgres behavior and disk compatibility.","github":"https://github.com/malisper/pgrust","url":"https://osrepos.com/repo/malisper-pgrust","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/malisper-pgrust","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/malisper-pgrust.md","json":"https://osrepos.com/repo/malisper-pgrust.json","topics":["Rust","Postgres","PostgreSQL","Database","AI-assisted Development","Backend","Open Source"],"keywords":["Rust","Postgres","PostgreSQL","Database","AI-assisted Development","Backend","Open Source"],"stars":null,"summary":"pgrust is an ambitious project rewriting Postgres in Rust, now successfully passing 100% of Postgres regression tests. It aims for compatibility with Postgres 18.3 and offers significant performance improvements, especially for transaction and analytical workloads. This project focuses on making internal changes easier while maintaining Postgres behavior and disk compatibility.","content":"## Introduction\npgrust is a groundbreaking project that re-implements the PostgreSQL database in Rust. It targets full compatibility with Postgres 18.3 and has achieved a significant milestone, passing 100% of the Postgres regression test suite. The project's core goal is to simplify internal modifications to Postgres, leveraging Rust's safety and performance, along with AI-assisted programming, to explore deeper server changes. pgrust is also disk compatible with Postgres, allowing it to boot from existing Postgres 18.3 data directories. An upcoming version promises a thread-per-connection model, 50% faster transaction workloads, and ~300x faster analytical workloads compared to Postgres.\n\n## Installation\nYou can try pgrust using Docker or by building it from source.\n\n### Docker:\nTo quickly run pgrust with Docker, use the following commands:\n\nbash\ndocker run -d --name pgrust -e POSTGRES_PASSWORD=secret malisper/pgrust:v0.1 && until docker exec -e PGPASSWORD=secret pgrust psql -h 127.0.0.1 -U postgres -c '\\q' >/dev/null 2>&1; do sleep 1; done && docker exec -it -e PGPASSWORD=secret pgrust psql -h 127.0.0.1 -U postgres; docker rm -f pgrust\n\n\nThis command will start a pgrust container, wait for it to be ready, connect using `psql` inside the container, and then remove the container.\n\n### Build From Source (macOS):\nFirst, install dependencies:\n\nbash\nbrew install icu4c openssl@3 libpq\n\nexport LIBRARY_PATH=\"$(brew --prefix openssl@3)/lib:${LIBRARY_PATH:-}\"\nexport PKG_CONFIG_PATH=\"$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:${PKG_CONFIG_PATH:-}\"\nexport PATH=\"$(brew --prefix libpq)/bin:$PATH\"\n\n\n### Build From Source (Debian/Ubuntu):\nInstall dependencies:\n\nbash\nsudo apt-get update\nsudo apt-get install -y build-essential pkg-config libicu-dev libssl-dev libldap2-dev libpam0g-dev postgresql-client-18\n\n\n### Build pgrust:\n\nbash\nPGRUST_PGSHAREDIR=\"$PWD/vendor/postgres-18.3/share\" \\\ncargo build --release --locked --bin postgres\n\n\n## Examples\nAfter building from source, you can create a data directory and run pgrust.\n\n### Create a data directory:\n\nbash\ntarget/release/postgres --initdb \\\n  -D /tmp/pgrust-data \\\n  -L \"$PWD/vendor/postgres-18.3/share\" \\\n  --no-locale \\\n  --encoding UTF8 \\\n  -U postgres\n\n\n### Run pgrust:\n\nbash\nulimit -s 65520\n\nRUST_MIN_STACK=33554432 target/release/postgres \\\n  -D /tmp/pgrust-data \\\n  -F \\\n  -c listen_addresses= \\\n  -k /tmp \\\n  -p 5432 \\\n  -c io_method=sync \\\n  -c max_stack_depth=60000\n\n\n### Connect to pgrust:\n\nbash\npsql -h /tmp -p 5432 -U postgres -d postgres \\\n  -c \"select version(), 1 + 1 as two\"\n\n\nYou can also try the [WebAssembly demo](https://pgrust.com) directly in your browser.\n\n## Why Use pgrust?\npgrust offers a fresh perspective on database development, aiming to overcome some of the traditional challenges with Postgres internals. Its roadmap includes exciting features like multithreaded Postgres internals, built-in connection pooling, improved JSON workload support, fast forking and branching workflows, and storage experiments with no-vacuum designs. By rewriting Postgres in Rust, the project seeks to enhance performance, maintainability, and introduce innovative features that are harder to implement in the original C codebase. While not yet production-ready, its progress in passing all regression tests and demonstrating significant speedups makes it a project to watch for future database solutions.\n\n## Links\n*   **GitHub Repository:** [https://github.com/malisper/pgrust](https://github.com/malisper/pgrust)\n*   **Browser Demo:** [https://pgrust.com](https://pgrust.com)\n*   **Discord Community:** [https://discord.gg/FZZ4dbdvwU](https://discord.gg/FZZ4dbdvwU)\n*   **Get Updates:** [https://pgrust.com/#updates](https://pgrust.com/#updates)","metrics":{"detailViews":1,"githubClicks":0},"dates":{"published":null,"modified":"2026-07-11T16:50:32.000Z"}}