Allow an alias to be attached to a JOIN ... USING

Peter Eisentraut <peter@eisentraut.org>

Commit: 055fee7eb4dcc78e58672aef146334275e1cc40d
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2021-03-31T15:10:50Z
Releases: 14.0
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 <vik.fearing@2ndquadrant.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/454638cf-d563-ab76-a585-2564428062af@2ndquadrant.com

Files

Documentation touched

Discussion