model-writtenrun 3773 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jeff Davis proposed SEARCH DEFAULT, SYSTEM, or SESSION to capture function authors' search_path intent and enable safer defaults, initially including a compatibility GUC and allowing explicit SET clauses to override the choice #1.
- Joe Conway questioned DEFAULT versus SESSION and temporary-schema safety; Jeff explained the compatibility distinction and confirmed that existing function lookup excludes temporary-schema functions #2 #4 #5.
- Andres Freund argued that search_path remained fragile, especially with extensions and overload resolution, and proposed resolving references to qualified names when functions are created; Jeff favored incremental search_path improvements that also help dynamically generated SQL #6 #7 #12.
- Peter Eisentraut and Robert Haas questioned adding another user-facing mechanism alongside SET search_path and suggested extending existing syntax, while Jeff defended SEARCH as a declaration of intent that could support safety checks for immutable functions and index expressions #8 #10 #13 #15.
- Robert explored captured search paths, function properties, and function-trust controls, emphasizing compatibility costs and opposing execution-time GUC switches that change existing functions' behavior #18 #23.
- Jeff revised the proposal to SEARCH FROM DEFAULT, TRUSTED, or SESSION, removed the compatibility GUC, prohibited explicit SESSION with IMMUTABLE, and added dump support, psql display, and procedure documentation while preserving the underlying implementation #24.
- Joe proposed separating executable-object lookup from table lookup; Jeff welcomed the possibility, while Robert regarded it as limited defense in depth and suggested annotating the existing path instead of introducing another GUC #27 #28 #30.
- The broader design remained disputed, and Jeff withdrew the SEARCH proposal from the commitfest for lack of consensus while inviting alternatives for safer search paths or warnings #32 #33.
- The thread resumed around performance: Jeff reported improvements from search-path caching but measured roughly 8000 ms with a function SET clause against 3800 ms without one, and Robert encouraged further reductions in the cost of securing functions #34 #35 #36.
- Robert suggested caching opaque GUC handles to avoid repeated hash lookups and replacing setjmp-based cleanup with an abort-time stack #37.
- Jeff implemented GUC-handle caching and reported an improvement from about 7300 ms to 6800 ms; John Naylor identified comment and pointer-return issues, which Jeff fixed together with simplifying the opaque type declaration #38 #39 #40.
- Jeff separately prototyped removal of PG_TRY/CATCH using transaction-aware wrapper cleanup, but its roughly 100 ms improvement approached measurement noise and correctness needed more work, so he declined to commit that form #41.
- In the final thread message, Jeff fixed the caching patch to reject unstable placeholder GUC handles and retain name-based fallback, declaring his intention to commit; the SEARCH proposal remained withdrawn and the cleanup experiment remained uncommitted #42 #33 #41.
- Jeff subsequently committed the caching work as 867dd2dc87 from #42, with moderate local changes that centralized optional-handle fallback in guc.c and added the typedef registration; this landing did not include SEARCH syntax or the PG_TRY/CATCH experiment.