2025年9月25日: PostgreSQL 18 釋出!
支援的版本: 當前 (18) / 17 / 16 / 15 / 14 / 13
開發版本: devel
不支援的版本: 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4

35.52. table_constraints #

檢視 table_constraints 包含當前使用者擁有或對其具有除 SELECT 之外任何許可權的所有表的約束。

表 35.50. 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 KEYPRIMARY KEYUNIQUE

is_deferrable yes_or_no

如果約束是可延遲的,則為 YES,否則為 NO

initially_deferred yes_or_no

如果約束是可延遲的且初始狀態為延遲,則為 YES,否則為 NO

enforced yes_or_no

如果約束已強制執行,則為 YES,否則為 NO

nulls_distinct yes_or_no

如果約束是唯一約束,則當約束將 NULL 值視為不同時為 YES,否則為 NO;對於其他型別的約束,則為 NULL。


提交更正

如果您在文件中發現任何不正確、與您在使用特定功能時的體驗不符或需要進一步澄清的內容,請使用 此表單 報告文件問題。