pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrei Lepikhov <lepihov@gmail.com>
Cc: splarv@ya.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18859: ERROR: unexpected plan node type: 356
Date: Fri, 21 Mar 2025 11:35:03 -0400
Message-ID: <1563711.1742571303@sss.pgh.pa.us> (raw)
In-Reply-To: <ee51b44b-8759-4600-a3af-c0565c9bea12@gmail.com>
References: <18859-0d5f28ac99a37059@postgresql.org>
	<72c3c1f4-9ed1-4d1c-ae67-eb04b8e50cd1@gmail.com>
	<1243263.1742562053@sss.pgh.pa.us>
	<ee51b44b-8759-4600-a3af-c0565c9bea12@gmail.com>

Andrei Lepikhov <lepihov@gmail.com> writes:
> On 21/3/2025 14:00, Tom Lane wrote:
>> Yeah, I'd just come to the same conclusion.  I guess we can make
>> this code look through a Material node as well as Gather.

> Yes, as I see there are no additional corner cases. See the code in 
> attachment.

I think actually we want to use the same processing as for Gather,
in particular the check for a Const.  That's all about what
setrefs.c will do to the plan tree, and it'll do the same things
to Material as it would to Gather.  Since that stanza doesn't
actually do anything that's specific to Gather, the code change
can be as simple as

@@ -8323,7 +8325,7 @@ exec_save_simple_expr(PLpgSQL_expr *expr, CachedPlan *cplan)
 				   ((Result *) plan)->resconstantqual == NULL);
 			break;
 		}
-		else if (IsA(plan, Gather))
+		else if (IsA(plan, Gather) || IsA(plan, Material))
 		{
 			Assert(plan->lefttree != NULL &&
 				   plan->righttree == NULL &&

I fixed that, did some cosmetic fooling with the comment
and test case, and pushed it.  Thanks for the report,
and for the patch!

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <1563711.1742571303@sss.pgh.pa.us>
Permalink:  ../1563711.1742571303@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1563711.1742571303@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, lepihov@gmail.com, splarv@ya.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18859: ERROR: unexpected plan node type: 356
  In-Reply-To: <1563711.1742571303@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