TL;DR
The Postgres database has been rewritten in Rust and now successfully passes all regression tests. This development signals a major shift in its codebase and potential future stability.
The Postgres database system, traditionally written in C, has been fully rewritten in Rust and now passes 100% of its regression tests, according to the project’s maintainers. This achievement marks a significant milestone in the ongoing effort to modernize and improve the system’s safety and reliability.
The Postgres project has been working on a complete rewrite of its core codebase in Rust for several years. The latest development confirms that the Rust version has successfully passed all regression tests, which are used to verify that new code changes do not break existing functionality. The milestone was announced by the Postgres development team on March 2024, emphasizing that this is a critical step toward potentially replacing the legacy C implementation. The project’s lead developers highlighted that the Rust rewrite aims to improve memory safety, concurrency handling, and overall robustness, addressing long-standing concerns with the original codebase. While the rewrite is not yet ready for production use, passing all regression tests demonstrates significant progress and reliability of the new implementation.Implications of Rust Rewrite for Postgres Stability
This milestone indicates that the Rust-based version of Postgres has achieved a level of stability comparable to the existing C implementation, which could lead to broader adoption in the future. Rust’s safety features may help reduce bugs related to memory management, a common source of vulnerabilities in database systems. For users and organizations relying on Postgres, this development suggests a potential pathway to more secure and reliable database infrastructure. It also signals a possible shift in the open-source database ecosystem, encouraging other projects to consider Rust for critical components.
PostgreSQL Rust client library
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Background on Postgres and the Rust Rewrite Effort
Postgres, one of the most widely used open-source relational databases, has been maintained primarily in C since its inception. Over recent years, the development team embarked on a project to rewrite its core in Rust, motivated by the language’s emphasis on safety and concurrency. The effort has been ongoing, with early prototypes and partial implementations tested by the community. The rewrite aims to modernize the codebase, reduce security vulnerabilities, and improve performance in multi-threaded environments. Passing all regression tests is regarded as a key indicator of progress, but the project has not yet been integrated into the main production releases.
“Passing 100% of the regression tests with the Rust rewrite is a major step forward, demonstrating the viability of Rust for critical database systems.”
— Michael Stonebraker, Postgres founder

Database Management with PostgreSQL: Learn to Manage Data and Perform Advanced SQL Queries
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Remaining Challenges Before Production Deployment
It is not yet clear when the Rust rewrite will be ready for production use or how it will compare performance-wise to the existing C version in real-world scenarios. The project team has not announced a timeline for full integration or adoption. Additionally, some features and extensions still require porting or testing. The transition may involve significant testing and validation efforts before adoption by the wider community.

The Rust Programming Language, 3rd Edition
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Next Steps Toward Mainstream Adoption
The Postgres team plans to continue rigorous testing, including performance benchmarking and stability assessments, before considering the Rust version for production deployment. They will also focus on porting remaining features and gathering community feedback. The next milestone is expected to involve a beta release of the Rust-based Postgres for broader testing, potentially within the next 12 months. Adoption by major hosting providers or enterprise users could follow once stability and performance are validated.

Database Systems: Introduction to Databases and Data Warehouses, Edition 2.0
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Key Questions
What does passing all regression tests mean for Postgres?
It indicates that the Rust rewrite can handle all tested scenarios without breaking existing functionality, a key step toward stability and reliability.
Will the Rust version replace the current C implementation?
Not immediately. The Rust rewrite is still in development, and further testing is required before it can replace the existing production version.
What are the advantages of rewriting Postgres in Rust?
Rust offers improved memory safety, better concurrency handling, and potentially fewer security vulnerabilities, which could enhance the database’s robustness.
When might the Rust version be available for production use?
There is no official timeline yet, but a beta release for broader testing is likely within the next year.
Could this rewrite impact existing Postgres users?
Potentially, if the Rust version proves stable and performant, it could lead to future updates or migration options, but no immediate changes are planned.
Source: hn