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

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, Daniel Farkaš <daniel(dot)farkas(at)datoris(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17502: View based on window functions returns wrong results when queried
Date: 2026-06-29 23:35:19
Message-ID: CAApHDvoxZCwf7js-Xc5L=3HV65VVOOAoNm=SeTpXG9sZhR5NJQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, 31 Jan 2023 at 11:53, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> > On Mon, May 30, 2022 at 9:12 AM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> >> The following is also pretty strange. Why should adding the SRF column
> >> to the ORDER BY change the number of output rows?
>
> > Is this a bug we should fix?
>
> 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?

David

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2026-06-30 02:27:05 Re: BUG #17502: View based on window functions returns wrong results when queried
Previous Message David Rowley 2026-06-29 23:32:52 Re: BUG #19535: Splitting window input targets can break same-level SRF lockstep semantics