Postgres Rewritten In Rust, Now Passing 100% Of The Postgres Regression Tests
AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Buying for a business?Offer from Amazon

Get business pricing on monitors, keyboards and dev gear

  • Business-only prices and quantity discounts
  • Tax-exempt purchasing
  • Multiple users, one account, clear invoices
As an affiliate, we earn on qualifying purchases.

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.

At a glance
updateWhen: announced March 2024
The developmentThe Postgres project announced that its Rust-based rewrite now passes 100% of its regression tests, a key milestone in its development.

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.

Amazon

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

Amazon

PostgreSQL database management tools

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.

Amazon

Rust programming language books

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.

Amazon

Database performance monitoring tools

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

HALLOWEEN

Halloween Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

JEP 541: Deprecate The macOS/x64 Port For Removal

OpenJDK proposes deprecating the macOS/x64 port via JEP 541, with plans for removal. The move impacts developers and users relying on this platform.

NetBSD 9.5 Released And EOL For NetBSD-9

NetBSD 9.5 has been officially released, marking the end of support for NetBSD-9. This update impacts users and developers relying on the OS.

Formal Methods With Hillel Wayne

Hillel Wayne discusses recent progress and applications of formal methods, highlighting their importance for software correctness and security.

New Mac Studio With M5 Max And M5 Ultra

Apple announces a new Mac Studio featuring M5 Max and M5 Ultra processors, offering significant performance upgrades for professional users.