Re: BUG #2549: problem with NATURAL JOIN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kayteck" <kayteck_master(at)o2(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2549: problem with NATURAL JOIN
Date: 2006-07-25 12:22:05
Message-ID: 8412.1153830125@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Kayteck" <kayteck_master(at)o2(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Enke 2006-07-25 16:06:19 BUG #2550: pg_dumpall 7.4.13 -> restore 8.1.4 problem
Previous Message Simon Riggs 2006-07-25 12:08:14 Re: BUG #2549: problem with NATURAL JOIN