model-writtenrun 2220 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed fixing leaks from failed function compilation by keeping the PL/pgSQL compilation context short-lived until success and freeing newly allocated CachedFunction structs when compilation throws an error #1.
- Tom followed the existing SQL-function context-reparenting approach, left a separate invalidation-message leak outside the patch's scope, and proposed targeting PostgreSQL 18 while questioning whether backpatching was worthwhile #1.
- Amul Sul found the patch reasonable and straightforward enough to backport, but questioned the need given the apparent rarity of the leak #2.
- Pavel Stehule endorsed Amul's assessment in the thread's final message; no revised attachment or definitive backport decision appeared in the discussion #3.
- Tom subsequently committed both fixes from #1 as be86ca103a, adding delayed initialization of cache validity fields and the cleanup callback until compilation succeeds; the commit targeted PostgreSQL 18 and declined backpatching given the lack of field complaints.