Updated on 2025-10-23 GMT+08:00

referential_constraints

The referential_constraints view provides information about foreign keys. This view is read-only. All users have the read permission on this view.

Table 1 information_schema.referential_constraints columns

Name

Type

Description

CONSTRAINT_CATALOG

varchar(512)

Name of the database to which the constraint belongs. The value is the database to which the constraint belongs. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

CONSTRAINT_SCHEMA

varchar(64)

Name of the schema to which the constraint belongs. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

CONSTRAINT_NAME

varchar(64)

Name of the constraint.

UNIQUE_CONSTRAINT_CATALOG

varchar(512)

Name of the catalog containing the UNIQUE constraint that the constraint references. The value is the database to which the UNIQUE constraint belongs. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

UNIQUE_CONSTRAINT_SCHEMA

varchar(64)

Name of the schema containing the UNIQUE constraint that the constraint references. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

UNIQUE_CONSTRAINT_NAME

varchar(64)

Name of the UNIQUE constraint that the constraint references.

MATCH_OPTION

varchar(64)

Value of the match constraint attribute.

UPDATE_RULE

varchar(64)

Value of the on update constraint attribute. The value is cascade, set null, set default, restrict, or no action.

DELETE_RULE

varchar(64)

Value of the on delete constraint attribute. The value is cascade, set null, set default, restrict, or no action.

TABLE_NAME

varchar(64)

Name of the table on which the constraint is defined. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

REFERENCED_TABLE_NAME

varchar(64)

Name of the table referenced by the constraint. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.