Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On Mon, 2 Oct 2023 at 01:01, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Yeah, that's exposing more of the implementation than we really want.
> Note that this isn't a new issue, specific to unnamed subqueries. The
> same thing happens for unnamed joins:
True, and we've had few complaints about that. Still, if we can
clean it up without too much effort, let's do so.
> So I think perhaps it's better to just have searchRangeTableForRel()
> exclude these kinds of RTE, if they haven't been given an alias.
Would we need a new flag in the ParseNamespaceItem data structure,
or will the existing data serve? I see how to do this if we add
a "doesn't really have a name" flag, but it's not clear to me that
we can reliably identify them otherwise. Maybe a test involving
the rtekind and whether the "alias" field is set would do, but
that way seems a bit ugly.
regards, tom lane