Commit 573aaa52 authored by Tom Lane's avatar Tom Lane

NATURAL CROSS JOIN is a contradiction in terms, not to mention disallowed

by the SQL spec and by our parser.  Thanks to Jonathan Scott for finding
this longstanding error.
parent 97c7cb09
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* back to source text * back to source text
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.164 2004/05/05 04:48:46 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.165 2004/05/07 03:19:44 tgl Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
...@@ -3788,14 +3788,9 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context) ...@@ -3788,14 +3788,9 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context)
switch (j->jointype) switch (j->jointype)
{ {
case JOIN_INNER: case JOIN_INNER:
if (j->quals)
appendContextKeyword(context, "NATURAL JOIN ", appendContextKeyword(context, "NATURAL JOIN ",
-PRETTYINDENT_JOIN, -PRETTYINDENT_JOIN,
PRETTYINDENT_JOIN, 0); PRETTYINDENT_JOIN, 0);
else
appendContextKeyword(context, "NATURAL CROSS JOIN ",
-PRETTYINDENT_JOIN,
PRETTYINDENT_JOIN, 0);
break; break;
case JOIN_LEFT: case JOIN_LEFT:
appendContextKeyword(context, "NATURAL LEFT JOIN ", appendContextKeyword(context, "NATURAL LEFT JOIN ",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment