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

From Kayteck
Subject BUG #2549: problem with NATURAL JOIN
Date
Msg-id 200607250058.k6P0wtp8065384@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #2549: problem with NATURAL JOIN  (Simon Riggs <simon@2ndquadrant.com>)
Re: BUG #2549: problem with NATURAL JOIN  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #2549: problem with NATURAL JOIN  (Michael Fuhr <mike@fuhr.org>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2549
Logged by:          Kayteck
Email address:      kayteck_master@o2.pl
PostgreSQL version: 8.1.3
Operating system:   Fedora Core 4
Description:        problem with NATURAL JOIN
Details:

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:
select id_zamowienia,id_przelewu from zamowienia where id_klienta=4999;
 id_zamowienia | id_przelewu
---------------+-------------
          7504 |        3095
          7503 |        3095
          7408 |        3095
(3 rows)

select id_przelewu from przelew where id_przelewu=3095;
 id_przelewu
-------------
        3095
(1 row)

select id_przelewu,id_zamowienia from zamowienia natural join przelew where
id_klienta=4999;
 id_przelewu | id_zamowienia
-------------+---------------
(0 rows)

select id_przelewu,id_zamowienia from zamowienia join przelew using (id_p
rzelewu) where id_klienta=4999;
 id_przelewu | id_zamowienia
-------------+---------------
        3095 |          7504
        3095 |          7503
        3095 |          7408
(3 rows)

It seems for an error of postgresql

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #2546: PostgreSQL does not have native spinlock
Next
From: John Weekley
Date:
Subject: Re: BUG #2546: PostgreSQL does not have native spinlock