model-writtenrun 5106 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane opened the thread because resolve_symlinks() temporarily changed directories and could fail to return to the original directory under restricted permissions, proposing simpler pathname processing in #1; Isaac Morland raised directory-race concerns in #2, and Tom explained why installation-path trust and obtaining a pathname were the relevant constraints in #3.
- Andrew Dunstan suggested using a library function in #4, and Tom selected realpath() with Windows _fullpath() and an EINVAL-triggered buffer fallback for older POSIX implementations in #5 and #6.
- Tom submitted the first implementation in #7, replacing the manual symlink traversal, fixing the Windows .exe suffix condition, and highlighting uncertainty about Windows error reporting.
- Peter Eisentraut challenged unconditional symlink resolution because pg_config exposed version-specific installation paths that could break dependent packages after upgrades in #10, #14, and #16; Andrew suggested preserving useful directory symlinks in #12, while Tom defended resolving executable symlinks to locate supporting installation files in #13.
- Thomas Munro tested Windows _fullpath(), found that it did not resolve symlinks or junctions, and recommended trusting its documented errno behavior instead of translating GetLastError() in #18.
- Tom's revision in #19 adopted Munro's error-handling recommendation and skipped realpath() for absolute paths whose final component was a regular file, while warning that preserving directory symlinks could let a running server unexpectedly switch installation directories.
- Peter supplied another example of resolved paths breaking after package upgrades in #20, and Tom proposed limiting changed symlink behavior to pg_config in #21; after Peter requested clarification in #22, Tom explained that compromise in #23.
- Tom committed 11a0a8b529 from #7, with Munro's Windows error-handling correction and comment edits, leaving out the second patch's conditional symlink preservation.
- At the thread's end, Tom confirmed the landing in #24 to obtain buildfarm portability feedback before feature freeze, leaving any change to when symlinks are resolved for a separate patch.