Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: xinwen(at)stu(dot)scu(dot)edu(dot)cn, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
Date: 2023-03-12 21:43:55
Message-ID: 1616392.1678657435@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:
> It is only possible to either leave such quals in the outer query in
> the WHERE clause or make them run conditions of some WindowClause in
> the subquery. They can never be legally in the WHERE clause of the
> subquery as window functions cannot be evaluated in the WHERE clause.

Ah, got it. So basically, the quals that we want are excluded by
check_output_expressions' point 4 (since they reference window
function output columns rather than partitioning columns). I think
we need them to satisfy every other property that's checked in this
code, though. Now I agree that we need to refactor a bit -- we
don't want to have to re-check all of these conditions.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-03-13 02:14:54 BUG #17834: Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))
Previous Message David Rowley 2023-03-12 21:19:45 Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c