文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 28 个 INFORMATION_SCHEMA 表 / 28.3 INFORMATION_SCHEMA 总表 / 28.3.41 INFORMATION_SCHEMA TABLE_CONSTRAINTS 表
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 89%

28.3.41 INFORMATION_SCHEMA TABLE_CONSTRAINTS 表28.3.41 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table

TABLE_CONSTRAINTS 表描述了哪些表具有约束。The TABLE_CONSTRAINTS table describes which tables have constraints.

TABLE_CONSTRAINTS 表包含以下列:The TABLE_CONSTRAINTS table has these columns:

  • CONSTRAINT_CATALOGCONSTRAINT_CATALOG

    约束所属的目录名称。该值始终为 def。The name of the catalog to which the constraint belongs. This value is always def.

  • CONSTRAINT_SCHEMACONSTRAINT_SCHEMA

    约束所属的模式(数据库)名称。The name of the schema (database) to which the constraint belongs.

  • CONSTRAINT_NAMECONSTRAINT_NAME

    约束的名称。The name of the constraint.

  • TABLE_SCHEMA

    表所属的模式(数据库)名称。The name of the schema (database) to which the table belongs.

  • TABLE_NAMETABLE_NAME

    表的名称。The name of the table.

  • CONSTRAINT_TYPE

    约束的类型。值可以是UNIQUE、PRIMARY KEY、FOREIGN KEY或CHECK。这是一个CHAR(不是ENUM)列。The type of constraint. The value can be UNIQUE, PRIMARY KEY, FOREIGN KEY or CHECK. This is a CHAR (not ENUM) column.

    UNIQUE和PRIMARY KEY信息与从SHOW INDEX输出中的Key_name列获取的信息差不多,当Non_unique列为0时。The UNIQUE and PRIMARY KEY information is about the same as what you get from the Key_name column in the output from SHOW INDEX when the Non_unique column is 0.

  • ENFORCEDENFORCED

    对于 CHECK 约束,值为 YES 或 NO,以表示该约束是否已执行。对于其他约束,值始终为 YES。For CHECK constraints, the value is YES or NO to indicate whether the constraint is enforced. For other constraints, the value is always YES.