Re: ExecTypeSetColNames is fundamentally broken

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ExecTypeSetColNames is fundamentally broken
Дата
Msg-id 3360468.1638824732@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ExecTypeSetColNames is fundamentally broken  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: ExecTypeSetColNames is fundamentally broken  (Robert Haas <robertmhaas@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: MSVC SSL test failure
Следующее
От: Peter Smith
Дата:
Сообщение: Re: parse_subscription_options - suggested improvements