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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: 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: 2022-05-30 03:02:49
Message-ID: 3730546.1653879769@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> On Mon, 30 May 2022 at 14:45, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> We could leave it alone in the back branches on the grounds that if
>> you like the results you get, we shouldn't break it in a minor
>> release.

> I struggle to see how anyone would like their result correctness to
> depend on whether remove_unused_subquery_outputs() is able or unable
> to remove a column from the subquery.

Indeed, it's unlikely that anybody would like these particular
results. But perhaps somebody is running an application that does
this and happens to not trip over any obviously-wrong case; for
example, if one always selects all columns from this view, the
issue is not apparent.

I'm not necessarily against adding the prohibition in the back
branches. However, if this has been wrong since 10.x (if not
further back) then it seems like few people are tripping over
the inconsistency.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2022-05-30 05:24:33 Re: BUG #17502: View based on window functions returns wrong results when queried
Previous Message David Rowley 2022-05-30 02:51:16 Re: BUG #17502: View based on window functions returns wrong results when queried