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