Re: BUG #17777: An assert failed in nodeWindowAgg.c - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #17777: An assert failed in nodeWindowAgg.c
Date
Msg-id 20230211004940.t5l2dz7rnss76zao@awork3.anarazel.de
Whole thread Raw
In response to Re: BUG #17777: An assert failed in nodeWindowAgg.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #17777: An assert failed in nodeWindowAgg.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #17777: An assert failed in nodeWindowAgg.c  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-bugs
Hi,

On 2023-02-10 18:57:10 -0500, Tom Lane wrote:
> I might be more excited about it if there were a visible use-case
> for volatile filter expressions, but I can't see one.  The presented
> test case is obviously just a fuzzer, not a useful query.

I don't care about the performance of such a query, but it doesn't seem great
that the defense that we do have, doesn't work.  It's not like we don't have a
fallback execution path, it's just that we don't know that we have to use it.


Do you think all other uses of contain_volatile_functions() (and it looks like
contain_mutable_functions()) are fine with not detecting volatility in
subplans?


I don't think it's common, but I don't think it's crazy to have a volatile
function somewhere within an aggregate.  pg_current_wal_lsn(),
clock_timestamp(), pg_relation_size() or such.


I think we could just add a !contain_subplans() to the code deciding whether
it's safe to use the movable window optimization?

Greetings,

Andres Freund



pgsql-bugs by date:

Previous
From: Jacob Champion
Date:
Subject: Re: BUG #17760: SCRAM authentication fails with "modern" (rsassaPss signature) server certificate
Next
From: Tom Lane
Date:
Subject: Re: BUG #17777: An assert failed in nodeWindowAgg.c