pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: xinwen@stu.scu.edu.cn
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
Date: Sat, 11 Mar 2023 12:23:56 -0500
Message-ID: <1229467.1678555436@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvoGAu9rY4iO0R+DZVxPck_M3015WUL_34XOhi9ygxYfnA@mail.gmail.com>
References: <17826-7d8750952f19a5f5@postgresql.org>
	<402866.1678378153@sss.pgh.pa.us>
	<CAApHDvoGAu9rY4iO0R+DZVxPck_M3015WUL_34XOhi9ygxYfnA@mail.gmail.com>

David Rowley <dgrowleyml@gmail.com> writes:
> On Fri, 10 Mar 2023 at 05:09, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> How is this even a little bit sane?

> I don't think it is.  I've not looked in detail yet, but I think we
> might be able to do something in check_output_expressions() so that we
> track the targetIsInAllPartitionLists() separately.  Maybe
> unsafeColumns[] needs to become an enum type that has UNSAFE, SAFE,
> WINDOW_RUNCONDITION_ONLY and then change things so we never make a
> runCondition when the qual is UNSAFE.

> Anyway, I'll give it more thought and aim to come up with a patch
> early next week.

Why can't we simply *remove* all this logic from subquery pushdown?

I would expect that what happens in useful cases is that we push down
the (safe) qual and then during planning of the subquery we see a WHERE
clause matching the window run condition and work with that.  So this
all seems redundant, quite aside from being faulty.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <1229467.1678555436@sss.pgh.pa.us>
Permalink:  ../1229467.1678555436@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1229467.1678555436@sss.pgh.pa.us

 · 

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: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, xinwen@stu.scu.edu.cn, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
  In-Reply-To: <1229467.1678555436@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox