Re: psql 7.3.4 disagrees with NATURAL CROSS JOIN - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql 7.3.4 disagrees with NATURAL CROSS JOIN
Date
Msg-id 27883.1083899335@sss.pgh.pa.us
Whole thread Raw
In response to Re: psql 7.3.4 disagrees with NATURAL CROSS JOIN  (Jonathan Scott <jwscott@vanten.com>)
List pgsql-hackers
Jonathan Scott <jwscott@vanten.com> writes:
> I have included a pg_dump of the schema that causes this problem. If
> you take out the word "CROSS" from my source files, it should load
> just fine. If you then pg_dump it, in there you should find "CROSS".

Indeed, I had just come to the conclusion that this test in ruleutils.c
is bogus:
               case JOIN_INNER:                   if (j->quals)                       appendContextKeyword(context,
"NATURALJOIN ",                                            -PRETTYINDENT_JOIN,
 PRETTYINDENT_JOIN, 0);                   else                       appendContextKeyword(context, "NATURAL CROSS JOIN
",                                           -PRETTYINDENT_JOIN,
PRETTYINDENT_JOIN,0);                   break;
 

and that it should just print NATURAL JOIN either way.  The code looks
significantly different in older versions, but the fundamental bug has
been there since the OUTER JOIN support was first committed nearly four
years ago.  You get some kind of gold star for being the first to find
it ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jonathan Scott
Date:
Subject: Re: psql 7.3.4 disagrees with NATURAL CROSS JOIN
Next
From: Rod Taylor
Date:
Subject: Re: ALTER TABLE TODO items