From 055fee7eb4dcc78e58672aef146334275e1cc40d Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 31 Mar 2021 17:09:24 +0200 Subject: Allow an alias to be attached to a JOIN ... USING This allows something like SELECT ... FROM t1 JOIN t2 USING (a, b, c) AS x where x has the columns a, b, c and unlike a regular alias it does not hide the range variables of the tables being joined t1 and t2. Per SQL:2016 feature F404 "Range variable for common column names". Reviewed-by: Vik Fearing Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/454638cf-d563-ab76-a585-2564428062af@2ndquadrant.com --- src/backend/nodes/readfuncs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/backend/nodes/readfuncs.c') diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 6a563e99033..4767e7092d7 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -1346,6 +1346,7 @@ _readJoinExpr(void) READ_NODE_FIELD(larg); READ_NODE_FIELD(rarg); READ_NODE_FIELD(usingClause); + READ_NODE_FIELD(join_using_alias); READ_NODE_FIELD(quals); READ_NODE_FIELD(alias); READ_INT_FIELD(rtindex); @@ -1449,6 +1450,7 @@ _readRangeTblEntry(void) READ_NODE_FIELD(joinaliasvars); READ_NODE_FIELD(joinleftcols); READ_NODE_FIELD(joinrightcols); + READ_NODE_FIELD(join_using_alias); break; case RTE_FUNCTION: READ_NODE_FIELD(functions); -- cgit v1.2.3