24.3.27 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table
The TABLE_CONSTRAINTS table describes which tables have constraints.
The TABLE_CONSTRAINTS table has these columns:
-
CONSTRAINT_CATALOGThe name of the catalog to which the constraint belongs. This value is always
def. -
CONSTRAINT_SCHEMAThe name of the schema (database) to which the constraint belongs.
-
CONSTRAINT_NAMEThe name of the constraint.
-
TABLE_SCHEMAThe name of the schema (database) to which the table belongs.
-
TABLE_NAMEThe name of the table.
-
CONSTRAINT_TYPEThe type of constraint. The value can be
UNIQUE,PRIMARY KEY,FOREIGN KEY, orCHECK. This is aCHAR(notENUM) column. TheCHECKvalue is not available until MySQL supportsCHECK.The
UNIQUEandPRIMARY KEYinformation is about the same as what you get from theKey_namecolumn in the output fromSHOW INDEXwhen theNon_uniquecolumn is0.
© 2025 Oracle
Licensed under the GPLv2 License.