Re: ExecTypeSetColNames is fundamentally broken - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ExecTypeSetColNames is fundamentally broken
Date
Msg-id 3360468.1638824732@sss.pgh.pa.us
Whole thread Raw
In response to Re: ExecTypeSetColNames is fundamentally broken  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: ExecTypeSetColNames is fundamentally broken  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I don't understand the code so I can't comment on the code, but I find
> the regression test changes pretty suspect. Attaching any alias list
> to the RTE ought to rename the output columns for all purposes, not
> just the ones we as implementers find convenient.

Well, that was what I thought when I wrote bf7ca1587, but it leads
to logical contradictions.  Consider

create table t (a int, b int);

create function f(t) returns ... ;

select f(t) from t;

select f(t) from t(x,y);

If we adopt the "rename for all purposes" interpretation, then
the second SELECT must fail, because what f() is being passed is
no longer of type t.  If you ask me, that'll be a bigger problem
for users than the change I'm proposing (quite independently of
how hard it might be to implement).  It certainly will break
a behavior that goes back much further than bf7ca1587.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: MSVC SSL test failure
Next
From: Peter Smith
Date:
Subject: Re: parse_subscription_options - suggested improvements