Re: foreign key to the *same* table?
From: Leandro Guimarães Faria Corsetti Dutra <lgcdutra_at_terra.com.br>
Date: Sat, 13 Sep 2003 11:24:40 +0200
Message-ID: <pan.2003.09.13.09.24.39.694131_at_terra.com.br>
Date: Sat, 13 Sep 2003 11:24:40 +0200
Message-ID: <pan.2003.09.13.09.24.39.694131_at_terra.com.br>
On Wed, 10 Sep 2003 00:05:46 +0200, Marco wrote:
> MySQL let me create the
> table and insert records, but problem begins with the clause ON DELETE SET
> NULL
First, beware of MySQL -- it is not ISO SQL compliant, it has
lotsa arbitrary restrictions. PostgreSQL is just as cheap, and much
better.
Second, think again... any solution involving NULLs is suspect. A nice, reationally sane solution to the hierarchy problem has been proposed by Fabian Pascal in his latest book, and it is a pearl of simplicity: simply a separate binary relation with the relationship between hierarchy nodes; for it, suffices two foreign keys to the main node relation.
-- _ Leandro Guimarães Faria Corsetti Dutra +41 (21) 648 11 34 / \ http://br.geocities.com./lgcdutra/ +41 (78) 778 11 34 \ / Answer to the list, not to me directly! +55 (11) 5686 2219 / \ Rate this if helpful: http://svcs.affero.net/rm.php?r=leandroReceived on Sat Sep 13 2003 - 11:24:40 CEST