summaryrefslogtreecommitdiff
path: root/src/include/nodes/parsenodes.h
diff options
context:
space:
mode:
authorPeter Eisentraut2021-03-31 15:09:24 +0000
committerPeter Eisentraut2021-03-31 15:10:50 +0000
commit055fee7eb4dcc78e58672aef146334275e1cc40d (patch)
tree2034e69c471453e9aea59712b09d3fed95bce330 /src/include/nodes/parsenodes.h
parent27e1f14563cf982f1f4d71e21ef247866662a052 (diff)
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 <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r--src/include/nodes/parsenodes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 334262b1dd8..7960cfe1a82 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -1070,6 +1070,13 @@ typedef struct RangeTblEntry
List *joinrightcols; /* right-side input column numbers */
/*
+ * join_using_alias is an alias clause attached directly to JOIN/USING. It
+ * is different from the alias field (below) in that it does not hide the
+ * range variables of the tables being joined.
+ */
+ Alias *join_using_alias;
+
+ /*
* Fields valid for a function RTE (else NIL/zero):
*
* When funcordinality is true, the eref->colnames list includes an alias