A project called pgrust has rewritten PostgreSQL entirely in Rust using LLMs, and now passes 100% of the official PostgreSQL regression tests. This demonstrates the feasibility of using AI to rewrite large, critical infrastructure software, potentially enabling faster innovation and safer memory management in databases. It also sparks debate on licensing, code review, and trust in AI-generated code. The rewrite uses LLMs to generate code and has produced over 7,000 commits in less than a month, making traditional code review impractical. The project is licensed under AGPL, which differs from PostgreSQL's permissive license.
Background
PostgreSQL regression tests are a comprehensive test suite that validates SQL implementation and extended features. LLM-based code generation is an emerging technique where large language models produce source code, which can accelerate development but raises concerns about correctness, security, and maintainability.
References
Discussion
The author explained the project as an experiment in using LLMs to build a better Postgres, and is working on a new version. Commenters raised concerns about reviewing AI-generated code due to the massive commit log, and debated the license change from PostgreSQL license to AGPL. Some suggested mirroring traffic to compare behavior under real load.