pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: xinwen@stu.scu.edu.cn, pgsql-bugs@lists.postgresql.org, David Rowley <david.rowley@2ndquadrant.com>
Subject: Re: BUG #17777: An assert failed in nodeWindowAgg.c
Date: Fri, 10 Feb 2023 18:12:32 -0500
Message-ID: <439391.1676070752@sss.pgh.pa.us> (raw)
In-Reply-To: <20230210230230.scuk6gqrks6c7sc7@awork3.anarazel.de>
References: <17777-860b739b6efde977@postgresql.org>
	<20230210230230.scuk6gqrks6c7sc7@awork3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> The problem is that normally we supress the moving aggregate optimization if a
> volatile function is contained in the filter. But unfortunately,
> contain_volatile_functions() doesn't descend into subplans. So we don't see
> the volatile expression.

I would say that if a volatile function in the argument crashes things,
that's an executor bug.  You won't get any sympathy from me for
complaints about whether contain_volatile_functions noticed that,
because *immutability markings can be lies*.  It is not acceptable
to crash if they're wrong.

It looks to me like maybe we could just remove the Assert and do

-	if (peraggstate->transValueCount == 1)
+	if (peraggstate->transValueCount < 2)

a few lines further down?  I've not dug into the details though.

			regards, tom lane





view thread (18+ messages)  latest in thread

Message-ID: <439391.1676070752@sss.pgh.pa.us>
Permalink:  ../439391.1676070752@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/439391.1676070752@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, andres@anarazel.de, david.rowley@2ndquadrant.com
  Subject: Re: BUG #17777: An assert failed in nodeWindowAgg.c
  In-Reply-To: <439391.1676070752@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