Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    43

    Unanswered: What must foreign key reference?

    I read something that made it seem as though InnoDB foreign keys can reference anything: primary keys, unique keys, and even non-unique columns...have I interpreted this correctly?

    What do MySQL's other storage engines like MyISAM allow for what foreign keys can reference? Can they reference anything, or just primary keys, or primary keys as well as unique keys?

    Thanks.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Foreign Keys defintions dont do anythingwork when using MyISAM
    see the MySQL site for further details, and even then it depends on what version of MySQL you are using.

    a Foreign Key constraint can only work on the referred (the "parent") table being unique keys which usually are also the primary key int he referred table.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •