The REFERENTIAL_CONSTRAINTS
table
provides information about foreign keys.
INFORMATION_SCHEMA
Name |
SHOW
Name |
Remarks |
CONSTRAINT_CATALOG | NULL | |
CONSTRAINT_SCHEMA | ||
CONSTRAINT_NAME | ||
UNIQUE_CONSTRAINT_CATALOG | NULL | |
UNIQUE_CONSTRAINT_SCHEMA | ||
UNIQUE_CONSTRAINT_NAME | ||
MATCH_OPTION | ||
UPDATE_RULE | ||
DELETE_RULE | ||
TABLE_NAME | ||
REFERENCED_TABLE_NAME |
Notes:
The REFERENTIAL_CONSTRAINTS
table
was added in MySQL 5.1.10. The
REFERENCED_TABLE_NAME
column was added in
MySQL 5.1.16.
TABLE_NAME
has the same value as
TABLE_NAME
in
INFORMATION_SCHEMA.TABLE_CONSTRAINTS
.
CONSTRAINT_SCHEMA
and
CONSTRAINT_NAME
identify the foreign key.
UNIQUE_CONSTRAINT_SCHEMA
,
UNIQUE_CONSTRAINT_NAME
, and
REFERENCED_TABLE_NAME
identify the
referenced key. (Note: Before MySQL 5.1.16,
UNIQUE_CONSTRAINT_NAME
incorrectly named
the referenced table, not the constraint.)
The only valid value at this time for
MATCH_OPTION
is NONE
.
The possible values for UPDATE_RULE
or
DELETE_RULE
are CASCADE
,
SET NULL
, SET DEFAULT
,
RESTRICT
, NO ACTION
.
User Comments
on windows, the values of referenced_table_name column are always in lowercase, even if you set lower_case_table_names = 0.
Add your own comment.