Re: BUG #2549: problem with NATURAL JOIN - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2549: problem with NATURAL JOIN
Date
Msg-id 8412.1153830125@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2549: problem with NATURAL JOIN  ("Kayteck" <kayteck_master@o2.pl>)
List pgsql-bugs
"Kayteck" <kayteck_master@o2.pl> writes:
> I have two tables joined by foreign key id_przelewu, and for some rows
> results of queries with NATURAL JOIN and JOIN ... USING (...) differs ! I've
> readed that NATURAL JOIN is only shorthand for the second method, but this
> results shows that's not true:

Your two examples are not necessarily equivalent --- in particular, if
id_przelewu isn't the only common column name in the two tables then
NATURAL JOIN isn't equivalent to a join USING only id_przelewu.
I would guess that there's some other column the NATURAL JOIN is trying
to match, and there are no matches.

If you think there's an actual bug here, you need to exhibit a complete
test case, which this most certainly wasn't.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Simon Riggs
Date:
Subject: Re: BUG #2549: problem with NATURAL JOIN
Next
From: Michael Fuhr
Date:
Subject: Re: BUG #2549: problem with NATURAL JOIN