From: Martijn Tonies Date: May 26 2005 7:12am Subject: Re: InnoDB to MyISAM List-Archive: http://lists.mysql.com/mysql/184626 Message-Id: <00d701c561c2$4172f610$3802a8c0@martijnws> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > >> I think you're confusing referential constraints with foreign keys. > > > > In my book, referential constraints and foreign key constraints (the full > > name) > > are the same. > > Yes, referential constraints and foreign key constraints are the same thing. > Notice the word constraints. > > Let me say this again: > > A foreign key is merely a column which references a primary key or a unique > key in the same or another table. > > A referential constraint (or foreign key constraint if you prefer) defines > an integrity condition that must be satisfied by all the rows in two tables. > > See the difference? So yes, MyISAM has foreign keys, no MyISAM does not > have foreign key constraints. Kindly don't go around saying MyISAM doesn't > have foreign keys because it simply makes no sense. Referential integrety > is not required for foreign keys. The only thing you need to have a foreign > key is a column which contains the value of a primary key or unique key in > another table. Right. We can agree on this wording if you like. I've never met it before in such a way though :-) Nevertheless, foreign key constraints belong in the database, not in your application... If you have foreign keys (your wording), you need foreign key constraints. Period. Plain and simple. No discussion :-) With regards, Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL Server Upscene Productions http://www.upscene.com