Re: BUG #19535: Splitting window input targets can break same-level SRF lockstep semantics
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: imchifan@163.com, pgsql-bugs@lists.postgresql.org
Date: 2026-06-29T23:32:52Z
Lists: pgsql-bugs
On Sun, 28 Jun 2026 at 00:55, PG Bug reporting form <noreply@postgresql.org> wrote: > ## Actual Behavior > > The query returns four rows instead of two: > > ```text > 1 | 1 | 11 > 1 | 1 | 12 > 1 | 2 | 11 > 1 | 2 | 12 > ``` > > The plan shows one `ProjectSet` below `WindowAgg` and another above it, > which breaks same-level SRF lockstep semantics. Thanks for the report. This is the same as what was discussed in bug #17502. There was a patch there to disallow SRFs in the WindowClause. I believe it was intended to go into master only, but that wasn't done. David [1] https://postgr.es/m/flat/17502-281a7aaacfaa872a%40postgresql.org
Commits
-
Disallow set-returning functions within window OVER clauses.
- 1de468099d27 master landed
- 0c15b715c651 19 (unreleased) landed