Documentation Home
MySQL 9.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 259.0Kb
Man Pages (Zip) - 366.2Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.0 Reference Manual  / ...  / INFORMATION_SCHEMA Tables  / INFORMATION_SCHEMA General Tables  /  The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table

28.3.41 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table

TheTABLE_CONSTRAINTS table describes which tables have constraints.

TheTABLE_CONSTRAINTS table has these columns:

  • CONSTRAINT_CATALOG

    The name of the catalog to which the constraint belongs. This value is alwaysdef.

  • CONSTRAINT_SCHEMA

    The name of the schema (database) to which the constraint belongs.

  • CONSTRAINT_NAME

    The name of the constraint.

  • TABLE_SCHEMA

    The name of the schema (database) to which the table belongs.

  • TABLE_NAME

    The name of the table.

  • CONSTRAINT_TYPE

    The type of constraint. The value can beUNIQUE,PRIMARY KEY,FOREIGN KEY orCHECK. This is aCHAR (notENUM) column.

    TheUNIQUE andPRIMARY KEY information is about the same as what you get from theKey_name column in the output fromSHOW INDEX when theNon_unique column is0.

  • ENFORCED

    ForCHECK constraints, the value isYES orNO to indicate whether the constraint is enforced. For other constraints, the value is alwaysYES.