model-writtenrun 8364 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported that PostgreSQL 12's Youngs–Cramer accumulation incorrectly returned zero for a single Inf or NaN input, and proposed initializing the affected sums to NaN instead of adding special handling during finalization #1.
- Tom posted regression tests, a floating-point fix restoring the earlier NaN results, and a separate numeric fix making sample variance and standard deviation return NULL for a single NaN; he proposed back-patching the floating-point regression but keeping the longstanding numeric behavior change on HEAD #2.
- Dean Rasheed supported the compatibility argument and the numeric NULL result, while questioning whether compilers would recognize that totCount was always initialized #3.
- Tom explained that the control flow guarantees initialization and accepted the possibility of warnings from ancient compilers, leaving the proposed code unchanged at the thread's final message #4.
- The tests and floating-point fix subsequently landed together unchanged in 03109a5302, with back-patching through PostgreSQL 12.
- The remaining numeric fix landed unchanged in 23cbeda50b without back-patching, completing the submitted series.