Re: BUG #18859: ERROR: unexpected plan node type: 356

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Andrei Lepikhov <lepihov@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, splarv@ya.ru, pgsql-bugs@lists.postgresql.org
Date: 2025-03-21T15:09:26Z
Lists: pgsql-bugs
On Fri, Mar 21, 2025 at 11:49 PM Andrei Lepikhov <lepihov@gmail.com> wrote:
> On 21/3/2025 14:00, Tom Lane wrote:
> > Andrei Lepikhov <lepihov@gmail.com> writes:
> >> The problem here is in the scrollable cursors code which inserts
> >> Material node:

> > 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.

A Material's tlist could also be a Const copied up by setrefs.c, in
which case we can avoid looking further, similar to what Gather does.
I wonder if we could have Material use the same handle as Gather.

-       else if (IsA(plan, Gather))
+       else if (IsA(plan, Gather) || IsA(plan, Material))

Thanks
Richard



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix plpgsql's handling of simple expressions in scrollable cursors.