Tom Lane wrote:
> ISTM that this should be represented using an RTE_SUBQUERY node in the
> outer query; the alias attaches to that node, not to the VALUES itself.
> So I don't think you need that alias field in the jointree entry either.
>
> If we stick with the plan of representing VALUES as if it were SELECT *
> FROM (valuesnode), then this approach would make the second query above
> have a structure like
>
> Query
> .rtable -> RTE_SUBQUERY
> .subquery -> Query
> .jointree -> Values
>
> (leaving out a ton of detail of course, but those are the key nodes).
>
OK, I'll go try to wrap my mind around that this evening and see where
it takes me.
Thanks,
Joe