Postgresql 中文操作指南
37.18. constraint_column_usage #
视图 constraint_column_usage 标识当前数据库中所有由某个约束使用的列。仅显示属于当前已启用角色所拥有表的列。对于检查约束,该视图会标识在检查表达式中使用的列。对于外键约束,该视图会标识外键引用的列。对于唯一或主键约束,该视图会标识受约束的列。
The view constraint_column_usage identifies all columns in the current database that are used by some constraint. Only those columns are shown that are contained in a table owned by a currently enabled role. For a check constraint, this view identifies the columns that are used in the check expression. For a foreign key constraint, this view identifies the columns that the foreign key references. For a unique or primary key constraint, this view identifies the constrained columns.
Table 37.16. constraint_column_usage Columns
Table 37.16. constraint_column_usage Columns
Column Type Description |
table_catalog sql_identifier Name of the database that contains the table that contains the column that is used by some constraint (always the current database) |
table_schema sql_identifier Name of the schema that contains the table that contains the column that is used by some constraint |
table_name sql_identifier Name of the table that contains the column that is used by some constraint |
column_name sql_identifier Name of the column that is used by some constraint |
constraint_catalog sql_identifier Name of the database that contains the constraint (always the current database) |
constraint_schema sql_identifier Name of the schema that contains the constraint |
constraint_name sql_identifier Name of the constraint |