Robert Haas <robertmh...@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