Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW

Edit
ID 6945
Title Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW
CI (CFBot) Needs rebase! Needs rebase since 2 weeks. Failing since 2 weeks.
Additional links previous successfully applied patch (outdated):
Stats (from CFBot) Unknown
Tags Bugfix
Created 2026-06-28 01:49:56
Last modified 2026-07-16 12:05:53 (5 days ago)
Latest email 2026-07-07 12:02:30 (2 weeks ago)
Status
PG20-1 (2026-07-01 – 2026-07-31): Committed
Target version 20
Authors Chengpeng Yan (chengpeng.yan)
Reviewers Become reviewer
Committer David Rowley (davidrowley)
Links
Emails
BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW
First at 2026-06-24 14:41:28 by PG Bug reporting form <noreply at postgresql.org>
Latest at 2026-07-07 12:02:30 by David Rowley <dgrowleyml at gmail.com>
Latest attachment (v4_fix_count_monotonic_detection.patch) at 2026-07-06 07:24:54 from David Rowley <dgrowleyml at gmail.com>
    Attachment (v4_fix_count_monotonic_detection.patch) at 2026-07-06 07:24:54 from David Rowley <dgrowleyml at gmail.com> (Patch: Yes)
    Attachment (runcond-failures-master.txt) at 2026-07-05 10:44:02 from John Naylor <johncnaylorls at gmail.com> (Patch: No)
    Attachment (v2-0001-Fix-COUNT-s-logic-for-window-run-condition-suppor.patch) at 2026-07-03 23:57:23 from David Rowley <dgrowleyml at gmail.com> (Patch: Yes)
    Attachment (v1-0001-Fix-COUNT-s-logic-for-window-run-condition-suppor.patch) at 2026-07-03 03:38:34 from David Rowley <dgrowleyml at gmail.com> (Patch: Yes)
    Attachment (v1-0001-Avoid-count-run-conditions-with-frame-exclusion.patch) at 2026-06-27 16:53:37 from Chengpeng Yan <chengpeng_yan at outlook.com> (Patch: Yes)
History
When Who What
2026-07-16 12:05:53 Ayush Tiwari (aytiwari) Closed in commitfest PG20-1 with status: Committed
2026-07-16 12:05:53 Ayush Tiwari (aytiwari) Changed committer to davidrowley
2026-07-05 11:03:29 CFbot Patch needs rebase
2026-06-28 01:49:56 Chengpeng Yan (chengpeng.yan) Attached mail thread 19533-413a1014e5d0e766@postgresql.org
2026-06-28 01:49:56 Chengpeng Yan (chengpeng.yan) Created patch record
Edit