Foreign keys / Transactions in MySQL.. WTF?
nicg at noslogan.org
Tue Jul 31 08:53:33 BST 2007
On 31/07/07, Jamie Nicholson <jamie.nicholson at gmail.com> wrote:
> >I need to confirm this in the manuals, but it seems to me that MySQL 4.1has
> >no support for foreign keys. If you're looking for a Relational Database
> >Management System, look another way ;-)
> This article gives an explanation of MYSQL foreign keys, might help.
>From said article (and yes, I'm also primarily a PostgreSQL person):
> In order to create a foreign key, you need the following:
>Both tables need to be InnoDB tables.
> To use the syntax FOREIGN KEY(fk_fieldname) REFERENCES table_name
Single field keys only? Or is that just the article?
> The field being declared a foreign key needs to be declared as an index in the
> table definition
Does this mean that keys and indices are the same thing in MySQL or is
it just the phrasing?
Director, Corbas Consulting Ltd
Editorial and Technical Consultancy
More information about the london.pm