Re: BUG #17502: View based on window functions returns wrong results when queried

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>, Daniel Farkaš <daniel.farkas@datoris.com>, Magnus Hagander <magnus@hagander.net>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2026-06-30T02:27:05Z
Lists: pgsql-bugs
David Rowley <dgrowleyml@gmail.com> writes:
> On Tue, 31 Jan 2023 at 11:53, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> This bug seems to have slipped off the radar screen, but it's still
>> a bug.  I continue to believe that the best fix is to disallow SRFs
>> in window definitions, and present the trivial patch to do so.
>> As discussed, I'm comfortable with leaving this alone in the back
>> branches.

> There has been another report about this in bug #19535. Should we
> consider going with disallowing SRFs in the WindowClause for v19?

Yeah, that slipped off the radar screen *again*.  Let's disallow
SRFs in WindowClauses in HEAD and v19, and see if anyone complains.

			regards, tom lane



Commits

  1. Disallow set-returning functions within window OVER clauses.