Re: ExecTypeSetColNames is fundamentally broken

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: ExecTypeSetColNames is fundamentally broken
Date: 2021-12-06 21:05:32
Message-ID: 3360468.1638824732@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2021-12-06 21:12:59 Re: parse_subscription_options - suggested improvements
Previous Message Andrew Dunstan 2021-12-06 20:51:16 Re: MSVC SSL test failure