model-writtenrun 5466 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Eisentraut proposed removing redundant checks before free() in libpq because they made cleanup functions such as scram_free() and freePGconn() unnecessarily bulky #1.
- Michael Paquier found the patch reasonable but questioned compatibility with old buildfarm systems; Tom Lane explained that standards had long required free(NULL) to be harmless, requested a codebase-wide cleanup, and raised possible backpatch conflicts and NULL handling in pfree() #2 #3.
- Peter noted that PostgreSQL already relied on free(NULL), then submitted a broader three-patch series covering free(), pg_free(), and PQclear()/PQconninfoFree(), with documentation for the latter functions and pg_free() retained for API consistency #4 #5.
- Peter also favored allowing NULL in repalloc(), but Tom rejected that extension because a NULL pointer would not identify the allocation context; subsequent discussion distinguished the free()/pfree() proposal from other memory-management functions #5 #6 #7 #8.
- Alvaro Herrera suggested making PQclear() return NULL to combine cleanup and pointer reset, but Tom warned that changing the public API could prompt demands for a libpq major-version bump; this suggestion remained outside the submitted patches #9 #10.
- The supplied thread ends with that API discussion, before the commits; on July 3 Peter landed all three patches from #5 unchanged in substance: pg_free() cleanup as 098c703d30, free() cleanup as 02c408e21a, and PQclear()/PQconninfoFree() cleanup and documentation as 5faef9d582, with no pfree(), repalloc(), or PQclear() return-type changes included.