model-writtenrun 1121 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Eisentraut opened the thread with an audit of potentially thread-unsafe server functions, identifying session-startup getopt() calls as needing a custom replacement and proposing separate work on environment, locale, and string-parsing functions #1; Jeff Davis pointed to existing collation patches #2.
- Heikki Linnakangas submitted a three-patch series that fixed a latent get_stats_option_name() bug, moved getopt state into a context exposed through pg_getopt_start()/pg_getopt_next(), and converted all server callers #3; client callers and getopt_long() were left alone because they did not need this change.
- After a long gap, Peter endorsed the latent-bug fix and the new API but suggested limiting conversion to process_postgres_switches(), since bootstrap and postmaster parsing did not require thread safety #4.
- Heikki retained the broader server conversion to establish a simple rule against plain getopt() in the server binary, agreed to leave client programs unchanged, and posted a rebase with no material implementation changes #5.
- Tom Lane proposed keeping the existing API with thread-local state to reduce developer overhead #6; Heikki explained the potential naming conflicts with exposed getopt globals #7, and Tom acknowledged that this prevented a purely internal replacement #8.
- Heikki committed the latent-bug fix unchanged from #5 as c5f7820e57, then committed the context-based implementation with clarified documentation and error reporting enabled by default as fd8e3f7cee.
- The server conversion landed unchanged from #5 as 681774315d, and Heikki confirmed completion #9; all three submitted patches had landed, while the broader thread-safety audit remained outside this series.