Re: BUG #18859: ERROR: unexpected plan node type: 356
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrei Lepikhov <lepihov@gmail.com>
Cc: splarv@ya.ru, pgsql-bugs@lists.postgresql.org
Date: 2025-03-21T15:35:03Z
Lists: pgsql-bugs
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
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix plpgsql's handling of simple expressions in scrollable cursors.
- c196c610b339 14.18 landed
- a28c1fb619bf 16.9 landed
- 7fe312f6092f 18.0 landed
- 5e56efa7c0e0 15.13 landed
- 1353b1161a79 17.5 landed
- 0f60e1fba137 13.21 landed