Re: BUG #17097: FailedAssertion at initsplan.c

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Naylor <john.naylor@enterprisedb.com>
Cc: cyg0810@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2021-07-09T17:39:58Z
Lists: pgsql-bugs
John Naylor <john.naylor@enterprisedb.com> writes:
> If it saves you some time, the assert happens here in
> replace_vars_in_jointree():

> case RTE_JOIN:
> case RTE_CTE:
> case RTE_NAMEDTUPLESTORE:
> case RTE_RESULT:
> /* these shouldn't be marked LATERAL */
> Assert(false);
> break;

> where the plan has RTE_RESULT

Ah.  When converting the FUNCTION RTE to a dummy RESULT,
we must clear its lateral flag to avoid making this
logic unhappy.  Fixed.

			regards, tom lane



Commits

  1. Avoid creating a RESULT RTE that's marked LATERAL.