From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix dumping of outer joins with empty qual lists. |
Date: | 2017-07-20 15:29:53 |
Message-ID: | E1dYDOj-0000I8-83@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix dumping of outer joins with empty qual lists.
Normally, a JoinExpr would have empty "quals" only if it came from CROSS
JOIN syntax. However, it's possible to get to this state by specifying
NATURAL JOIN between two tables with no common column names, and there
might be other ways too. The code previously printed no ON clause if
"quals" was empty; that's right for CROSS JOIN but syntactically invalid
if it's some type of outer join. Fix by printing ON TRUE in that case.
This got broken by commit 2ffa740be, which stopped using NATURAL JOIN
syntax in ruleutils output due to its brittleness in the face of
column renamings. Back-patch to 9.3 where that commit appeared.
Per report from Tushar Ahuja.
Discussion: https://postgr.es/m/98b283cd-6dda-5d3f-f8ac-87db8c76a3da@enterprisedb.com
Branch
------
REL9_5_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/c2bbec9f2b3672f57be27e20f26db141ab430da8
Modified Files
--------------
src/backend/utils/adt/ruleutils.c | 5 +++++
src/test/regress/expected/create_view.out | 29 +++++++++++++++++++++++++++++
src/test/regress/sql/create_view.sql | 10 ++++++++++
3 files changed, 44 insertions(+)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2017-07-20 16:42:07 | pgsql: Doc: clarify description of degenerate NATURAL joins. |
Previous Message | Tom Lane | 2017-07-19 20:17:08 | pgsql: Add static assertions about pg_control fitting into one disk sec |