|
Posted by Erwin Moller on 01/24/07 11:35
Hi Group,
Coming from Postgres, still learning mysql, so be gentle. :)
[I posted this question in alt.comp.database.mysql but that group doesn't
seem to be very active, and I am in a hurry, so forgive me for asking
here.]
I use mysql 5 with innodb engine.
When I create a table like:
create table tbltest(
testid int(10) UNSIGNED NOT NULL auto_increment,
artid int(10) UNSIGNED NOT NULL REFERENCES tblart.artid,
PRIMARY KEY (testid)
) ENGINE=InnoDB;
Works fine.
If I insert a value in artid that doesn't exist in tblart, mysql produces an
error as it should do.
Now if I want to find out about the tablestructure, like this:
SHOW CREATE TABLE tbltest;
mysql just shows the create table syntax, BUT without the FK-constraint.
When looking through the documentation I only found SHOW TRIGGERS, but that
also doesn't list the FKs.
I must be missing something completely in the docs. :-/
How can I ask mysql which Foriegn Keys it has?
TIA
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|