John Naylor <john(dot)naylor(at)enterprisedb(dot)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