历史版本。 PostgreSQL 12 已结束支持。 2024-11-21. 请参阅 当前版本手册.
36.51. table_constraints #
视图 table_constraints 包含属于特定表的所有约束,这些表要满足的条件是:当前用户拥有表或者是当前用户在表上具有某种除 SELECT 之外的权限。
表 36.49. table_constraints 列
| 名称 | 数据类型 | 描述 |
|---|---|---|
constraint_catalog | sql_identifier | 包含该约束的数据库名称(总是当前数据库) |
constraint_schema | sql_identifier | 包含该约束的模式名称 |
constraint_name | sql_identifier | 约束的名称 |
table_catalog | sql_identifier | 包含该表的数据库名称(总是当前数据库) |
table_schema | sql_identifier | 包含该表的模式名称 |
table_name | sql_identifier | 表的名称 |
constraint_type | character_data |
约束类型:CHECK、FOREIGN KEY、PRIMARY KEY 或 UNIQUE
|
is_deferrable | yes_or_no |
如果该约束是可延迟的,则为 YES,否则为 NO
|
initially_deferred | yes_or_no |
如果该约束是可延迟的且初始就被延迟,则为 YES,否则为 NO
|
enforced | yes_or_no | 适用于 PostgreSQL 尚不提供的功能(当前总是 YES) |