Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> I tried looking for other places that change an RTE's rtekind, and
> haven't managed to find any other problems, but may have missed
> something.
The only other place I can find that converts some other kind of RTE
to a subquery is inline_cte(), which converts RTE_CTE to RTE_SUBQUERY.
That seems immune to the present problem because the appropriate
vartype would be RECORD in either case.
regards, tom lane