model-writtenrun 9791 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Paul Guo reported that interrupting a shell script after it launched PostgreSQL through pg_ctl could also stop the server, and proposed calling setsid() inside postmaster in #1.
- Tom Lane objected that unconditional detachment would interfere with manual starts and debugging in #2, so Paul moved setsid() into pg_ctl's child process before exec in #3.
- Michael Paquier found that the revised patch prevented Ctrl-C from aborting a server still starting or recovering and requested optional detachment in #4; Tom favored detachment by default and explored delaying it until startup completed in #5 and #6.
- Andrew Gierth explained the process-group-leader restriction on setsid() and why ignoring failure would leave the controlling terminal attached in #7 and #9; Tom consequently explored a postmaster switch in #10, while Andres Freund opposed restoring self-daemonization because of existing scripts, service managers, and continuing OOM concerns in #13.
- Michael marked the patch returned with feedback in #14; Heikki Linnakangas revived it in #15, explaining that delayed detachment could leave auxiliary processes in the old session and proposing pg_ctl-side SIGINT forwarding to preserve startup cancellation.
- Heikki supplied the combined implementation in #18, accepting a small interruption race between launching the server and installing the handler and recommending no backpatch because existing scripts might depend on the old behavior in #17.
- Tom reviewed the race, considered alternative signal handling, and accepted the implementation with a comment correction in #19; Heikki applied that correction and comment reflow, committed bb24439cef from #18, and confirmed completion in #20, leaving no outstanding patch in the thread.