public inbox for [email protected]
help / color / mirror / Atom feedFrom: Ilya Anfimov <[email protected]>
To: [email protected]
Subject: Re: BUG #17502: View based on window functions returns wrong results when queried
Date: Mon, 30 May 2022 13:27:53 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<CABUevEz7t3OWxaSSVSHOxa5KcYioOk=yRwoL3iMViyZQ8m2wAw@mail.gmail.com>
<CAGckUK2GLF=d9J5ErEWgK5x8ECqCw4equnq3jEzrqtfJw+iHYw@mail.gmail.com>
<CAApHDvoR4BXm7oxSrYhpEAFOZ-qMPkkYnn14y6sxtPf=5w5OOw@mail.gmail.com>
<[email protected]>
On Sun, May 29, 2022 at 10:18:59PM -0400, Tom Lane wrote:
> David Rowley <[email protected]> writes:
> > The problem seems to be down to the fact that
> > remove_unused_subquery_outputs() does not check if the to-be-removed
> > target entry references WindowClauses which contain set-returning
> > functions.
>
> I was sort of wondering why we allow SRFs in this context in the
> first place. The results don't seem terribly well-defined to me.
> In particular, a WindowFunc invocation is not supposed to change the
> number of rows in the query result, and yet this one is doing so.
I would like to note, that some SRFs may return only one row in
specific cases, like dblink() with the specific query.
It may used much more often, than real multirow SRFs in PARTITION BY.
While converting it to a LATERAL JOIN is not a lot of work --
breaking it in previous versions may affect a lot of people.
view thread (18+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: BUG #17502: View based on window functions returns wrong results when queried
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox