The TABLE_CONSTRAINTS
table describes which
tables have constraints.
INFORMATION_SCHEMA
Name
|
SHOW Name
|
Remarks |
CONSTRAINT_CATALOG
|
NULL
|
|
CONSTRAINT_SCHEMA
|
||
CONSTRAINT_NAME
|
||
TABLE_SCHEMA
|
||
TABLE_NAME
|
||
CONSTRAINT_TYPE
|
Notes:
-
The
CONSTRAINT_TYPE
value can beUNIQUE
,PRIMARY KEY
, orFOREIGN KEY
. -
The
UNIQUE
andPRIMARY KEY
information is about the same as what you get from theKey_name
field in the output fromSHOW INDEX
when theNon_unique
field is0
. -
The
CONSTRAINT_TYPE
column can contain one of these values:UNIQUE
,PRIMARY KEY
,FOREIGN KEY
,CHECK
. This is aCHAR
(notENUM
) column. TheCHECK
value is not available until we supportCHECK
.