LLMs let me maintain my PostgreSQL extension for PRQL after becoming a parent
by kaspermarstal | 2025-11-09 10:32:30+00:00
Gather around kids, it's storytime. Let me tell you about the time AI saved my open source project from my children.

Once upon a time there was an open source developer who maintained a PostgreSQL extension for PRQL with hundreds of sparkling stars on Github and he had everything his heart desired. But then, a beautiful woman came into his life and offered him her love in return for his devotion. Enchanted by her looks, the developer accepts without hesitation and walks right into it as she reveals the true nature of her gift: two little shits - errh, kids - who will go on to take all his time away from his computer.

Our story began when a critical dependency shipped a breaking change [1] that prevented the extension from supporting PostgreSQL 17. But alas, the maintainer had no time for software engineering. "Fear not girlfriend!", said the maintainer, "For I will vibe code a fix!". And he summoned Claude Code and touched his keyboard in english places, for he had spent their coin on Claude's Max Plan.

For three nights he labored: The first night brought real progress and the model successfully figured out how to return pgrx::Datum via pgrx::RetAbi. On the second night, the model could not generalize its findings to pgrx::TableIterator and pgrx::SetOfIterator because column types were unknown at compile time. On the third night, the girlfriend said "get your shit together and help me with the kids" and branch pgrx-v0.12.9 [2] faded into obscurity.

As seasons passed and PostgreSQL 18 was released, users grew disillusioned for their sequential transformations of relational data that starts with "FROM" and not with "SELECT" were stuck in PostgreSQL 16. Ashamed of his abandoned repo the developer compartmentalized his failure, for how could he ever learn to maintain open source projects with two small kids?

The answer, as it turned out, was to wait for better models. When Anthropic released Claude Sonnet 4.5, the maintainer tried again. His eyes widened as Claude Code cloned https://github.com/postgres/postgres and inspected PostgreSQL internals exactly as he would have done in a previous life. With the help of WebSearch and a comprehensive test suite that was well understood because it was written before GPT 3.5, the model figured out how to return pg_sys::Datums, SetOf records, and even HeapTuples. By the power of his trust in the tests, the maintainer quickly released v18.0.0 [3] and no longer felt bad about the link on https://prql-lang.org/ that sent thousands of visitors to his repository.

Before our story ends, the maintainer asked the model for certain quality improvements. After a couple of "You are absolutely right!" and spectacular fuckups, he realized some aesthetics must be wrought by human hands. And so he made manual refactorings in commits 82dbc44 [4] and d61d04ad [5], pushed v18.0.1 [6], and lived happily ever after. Who needs time when you have Claude Sonnet 4.5?

[1] https://github.com/pgcentralfoundation/pgrx/pull/1701 [2] https://github.com/kaspermarstal/plprql/compare/main...pgrx-v0.12.9 [3] https://github.com/kaspermarstal/plprql/releases/tag/v18.0.0 [4] https://github.com/kaspermarstal/plprql/commit/82dbc44808871f60d0cc42b65124faf56f387db4 [5] https://github.com/kaspermarstal/plprql/commit/d61d04ad735765ef87f4f67d57ecaf0da27aad51 [6] https://github.com/kaspermarstal/plprql/releases/tag/v18.0.1