model-writtenrun 5487 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Pavel Stehule proposed PSQL_WATCH_PAGER to send repeated query results to pspg's streaming mode and stop watching when the pager exits #1.
- Tom Lane questioned ordinary-pager usability and how successive results would be distinguished #2; Pavel explained that specialized pagers such as pspg understand watch output #3.
- After Pavel rebased the proposal in January 2021 #4, Thomas Munro tested it successfully but identified stale comments, unsafe signal-state typing, and delayed detection of pager exit #5.
- Pavel floated explicit stream-boundary characters #6, but the subsequent patches retained ordinary psql output and instead replaced SIGPIPE detection with waitpid polling #7.
- Pavel isolated unsupported Windows child-process detection #8 and made watch paging honor the existing pager setting #9.
- Thomas replaced repeated polling with sigwait and an interval timer, supplying the change as a fixup alongside the complete pager patch #10; Pavel endorsed that approach #13.
- Testing exposed a separate pspg problem on macOS #11, which Thomas traced to polling /dev/tty #16; he verified the workaround #18, and Pavel reported its release in pspg #22.
- Thomas consolidated the pager patches, corrected blocked Ctrl-C during query execution, polished documentation, and disabled the feature on Windows because it could not be adequately validated #19.
- An upstream query-processing refactor forced a rebase that temporarily replaced and restored pset.queryFout #23; after that refactor was reverted, Thomas explained that uncertainty over this adaptation had kept the feature out of PostgreSQL 14 #25.
- Pavel continued rebasing #24 #27 and reported a Windows failure #28; Thomas added missing signal-handler guards and removed the obsolete output-restoration workaround #30.
- Pavel tested the final version with released and development pspg builds #32, and Thomas reported committing it after testing on macOS, FreeBSD, and Linux #33; 7c09d2797e follows #30 with a small Windows loop-counter type correction.
- After the pager feature landed, Tom reported that Ctrl-C left the next prompt beside the echoed interrupt characters and confused line editing, suggesting explicit cancellation output #35.
- The display fix remained outstanding into March 2022 #37 #38, before Pavel supplied a patch printing a cancellation message when no pager was active #39.
- Thomas reproduced cursor corruption with libedit, proposed emitting only a newline, and identified the issue on release branches too #40; Tom accepted the smaller change and backpatching but requested an explanation of the pager condition #41.
- Thomas added that explanation #42, and Pavel's final reply supported the assumption that modern pagers restore the cursor correctly #43; the thread ended with the fix awaiting commitment.
- The later commit 21267b6477 landed the fix from #42 with only rebasing and comment wrapping, and was backpatched to supported branches, completing both changes.