Join Correlation Name

From: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Join Correlation Name
Date: 2019-10-29 10:47:48
Message-ID: 2aa57950-b1d7-e9b6-0770-fa592d565dda@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When joining tables with USING, the listed columns are merged and no
longer belong to either the left or the right side.  That means they can
no longer be qualified which can often be an inconvenience.

SELECT a.x, b.y, z FROM a INNER JOIN b USING (z);

The SQL standard provides a workaround for this by allowing an alias on
the join clause. (<join correlation name> in section 7.10)

SELECT j.x, j.y, j.z FROM a INNER JOIN b USING (z) AS j;

Attached is a patch (based on 517bf2d910) adding this feature.

--

Vik Fearing

Attachment Content-Type Size
join_correlation_name.v01.patch text/x-patch 5.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2019-10-29 10:50:01 Re: Problem with synchronous replication
Previous Message Etsuro Fujita 2019-10-29 10:29:32 Re: [HACKERS] advanced partition matching algorithm for partition-wise join