Search Postgresql Archives

NATURAL JOINs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all.

I'm running v8.3.3

First point.
Is there a way to know how a NATURAL JOIN is actually done?
That is, which fields are actually used for the join?
The EXPLAIN directive doesn't show anyting useful.

Second point.
I have this:

CREATE TABLE tab_dictionary ( item text primary key );

CREATE TABLE tab_atable(
  item1 TEXT NOT NULL REFERENCES tab_dictionary( item ),
  item2 TEXT NOT NULL REFERENCES tab_dictionary( item ),
  trans NUMERIC NOT NULL
);

INSERT INTO tab_dictionary VALUES ( 'meters' ),('feet' );

INSERT INTO tab_atable VALUES ( 'meters','feet',3.28084 );

SELECT * FROM tab_atable NATURAL JOIN tab_dictionary;
 item1  | item2 |  trans  |  item
--------+-------+---------+--------
 meters | feet  | 3.28084 | meters
 meters | feet  | 3.28084 | feet
(2 rows)

Very likely I'm wrong, but this output looks wrong to me (and shold be wrong 
also accordingly to the documentation).
Is there ant good explaination to this behaviour?

Thanks.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux