Re: ExecTypeSetColNames is fundamentally broken
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-12-06T21:05:32Z
Lists: 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
Commits
-
Don't bother to attach column name lists to RowExprs of named types.
- d7b5c071dd6a 15.0 landed
-
Revert applying column aliases to the output of whole-row Vars.
- ec62cb0aac5b 15.0 landed
- 5e144cc89b46 13.7 landed
- 205214c8b8cc 10.21 landed
- 1f5ef5ae0806 12.11 landed
- 1d072bd2030a 14.3 landed
- 13b54d1e0dde 11.16 landed