Re: magical eref alias names - Mailing list pgsql-hackers

From Tom Lane
Subject Re: magical eref alias names
Date
Msg-id 3489021.1731015510@sss.pgh.pa.us
Whole thread Raw
In response to Re: magical eref alias names  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Nov 7, 2024 at 4:07 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Is there some strong reason to insist on making that core-dump-risking
>> change, rather than simply assigning the now-one-size-fits-all alias
>> when creating Alias nodes?

> What I'm unhappy about is not being able to tell the difference
> between a name that was invented by or at least meaningful to the user
> and one that isn't.

You can already tell that, by looking to see whether
RTE->alias->aliasname exists.  eref is meant to be the resolved
name-to-use not the user's original input.

> I would be more sympathetic to the idea of system-generated aliases if
> they were generated in a way that made it likely that they would be
> meaningful to the user. In fact, if they were generated in such a way
> that they would be unique, that would actually be fantastic and I
> would definitely not be arguing for removing them.

The trick there is to keep them predictable, because as I mentioned in
my previous response, there may be people depending on knowing what
name will be assigned.  We're working with a ton of history here,
and I'm not really convinced that change will be change for the
better.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Commit Timestamp and LSN Inversion issue
Next
From: Tom Lane
Date:
Subject: Re: Alias of VALUES RTE in explain plan