Skip site navigation (1) Skip section navigation (2)

BUG #2549: problem with NATURAL JOIN

From: "Kayteck" <kayteck_master(at)o2(dot)pl>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2549: problem with NATURAL JOIN
Date: 2006-07-25 00:58:55
Message-ID: 200607250058.k6P0wtp8065384@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2549
Logged by:          Kayteck
Email address:      kayteck_master(at)o2(dot)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

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2006-07-25 01:43:13
Subject: Re: BUG #2546: PostgreSQL does not have native spinlock
Previous:From: Ricardo SolanillaDate: 2006-07-24 11:31:00
Subject: BUG #2548: Fatal error with timezone

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group