34.33. referential_constraints

视图referential_constraints包含当前数据库里的所有参考(外键)约束。 只有当前用户有权访问的引用表里的约束才显示(通过成为所有者或有某些权限,而不是SELECT)。

Table 34-31. referential_constraints 字段

名字 数据类型 描述
constraint_catalog sql_identifier 包含这个约束的数据库名字(总是当前数据库)
constraint_schema sql_identifier 包含这个约束的模式名字
constraint_name sql_identifier 这个约束的名字
unique_constraint_catalog sql_identifier 包含该外键约束引用的唯一或者主键约束的数据库名称(总是当前数据库)
unique_constraint_schema sql_identifier 该外键约束引用的唯一或者主键约束的模式的名称
unique_constraint_name sql_identifier 该外键约束引用的唯一或者主键约束的名称
match_option character_data 该外键约束的匹配选项:FULL,PARTIAL,或者NONE
update_rule character_data 这个外键约束的更新规则:CASCADE, SET NULL, SET DEFAULT, RESTRICT或者NO ACTION
delete_rule character_data 这个外键约束的删除规则CASCADE, SET NULL, SET DEFAULT, RESTRICT或者NO ACTION