From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: xinwen@stu.scu.edu.cn
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17777: An assert failed in nodeWindowAgg.c
Date: Sun, 12 Feb 2023 19:55:37 -0500
Message-ID: <988099.1676249737@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvrfuSuFq57EtbYxHNWYhMET9K_TpSefDUoM52-T6LCYbg@mail.gmail.com>
References: <17777-860b739b6efde977@postgresql.org>
<20230210230230.scuk6gqrks6c7sc7@awork3.anarazel.de>
<439391.1676070752@sss.pgh.pa.us>
<20230210232051.efjhtoqo6odk3gke@awork3.anarazel.de>
<443909.1676073430@sss.pgh.pa.us>
<20230211004940.t5l2dz7rnss76zao@awork3.anarazel.de>
<CAApHDvpeXSU4A=mzX=96Rdn6u4gjVLHy8SMaVm_g01S8yhfAoQ@mail.gmail.com>
<842393.1676218781@sss.pgh.pa.us>
<CAApHDvrfuSuFq57EtbYxHNWYhMET9K_TpSefDUoM52-T6LCYbg@mail.gmail.com>
David Rowley <dgrowleyml@gmail.com> writes:
> On Mon, 13 Feb 2023 at 05:19, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Why is it okay to check only the filter, and not the rest of the
>> WindowFunc's subexpressions? The arguments we've just run through
>> seem to apply to a subplan in the direct or aggregated arguments
>> as well.
> Good point. I had just been thinking in terms of the reported bug to
> make sure we inverse transition the same rows we transition. We also
> need to make sure the transition value matches in both transition
> directions.
> I've adjusted the patch accordingly.
Code looks good now, but the comment still claims this is only
important in the FILTER clause. I'd rewrite the whole thing
perhaps:
* We also don't risk using moving aggregates when there are subplans
* in the arguments or FILTER clause. This is partly because
* contain_volatile_functions() doesn't look inside subplans; but
* there are other reasons why a subplan's output might be volatile.
* For example, syncscan mode can render the results nonrepeatable.
regards, tom lane
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, andres@anarazel.de, xinwen@stu.scu.edu.cn, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17777: An assert failed in nodeWindowAgg.c
In-Reply-To: <988099.1676249737@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