Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, Chengpeng Yan <chengpeng_yan(at)outlook(dot)com>, "imchifan(at)163(dot)com" <imchifan(at)163(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW
Date: 2026-07-03 09:11:13
Message-ID: CANWCAZbhqpLOWKLx4FSdwRFuBDG6YLjdYkDyy7hCbO0wOngb-A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Jul 3, 2026 at 4:09 PM John Naylor <johncnaylorls(at)gmail(dot)com> wrote:
> =# SELECT * FROM
> (SELECT x,
> count(*) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) c
> FROM t7) s
> WHERE c + 0 >= 2; -- baseline
> x | c
> ---+---
> 2 | 2
> 2 | 3
> (2 rows)

Sorry, this last result should be

x | c
---+---
8 | 2
9 | 3
(2 rows)

--
John Naylor
Amazon Web Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message John Naylor 2026-07-03 09:09:52 Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW