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

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-06-17T14:40:57Z
Lists: pgsql-hackers

Attachments

A small new feature in SQL:2016 allows attaching a table alias to a
JOIN/USING construct:

    <named columns join> ::=
      USING <left paren> <join column list> <right paren>
      [ AS <join correlation name> ]

(The part in brackets is new.)

This seems quite useful, and it seems the code would already support
this if we allow the grammar to accept this syntax.

Patch attached.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Commits

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

  2. Add p_names field to ParseNamespaceItem