
.. _table_constraints:

table_constraints
================================

视图\ ``table_constraints``\ 包含属于特定表的所有约束，这些表要满足的条件是：当前用户拥有表或者是当前用户在表上具有某种除\ ``SELECT``\ 之外的特权。

.. table:: table_constraints列
      :name: id-1.5.4.7.54.3
      :widths: 3 2 3 
      :class: longtable

      +------------------------+--------------------+-----------------------------+
      | 名称                   | 数据类型           | 描述                        |
      +========================+====================+=============================+
      | ``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``\ 、       |
      |                        |                    | ``FOREIGNKEY``\ 、          |
      |                        |                    | \ ``PRIMARYKEY``\           |
      |                        |                    | 或\ ``UNIQUE``              |
      +------------------------+--------------------+-----------------------------+
      | ``is_deferrable``      | ``yes_or_no``      | 如果该约束是                |
      |                        |                    | 可延迟的，则为\ ``YES``\ ， |
      |                        |                    | 否则为\ ``NO``              |
      +------------------------+--------------------+-----------------------------+
      | ``initially_deferred`` | ``yes_or_no``      | 如果该约束                  |
      |                        |                    | 是可延迟的并且是初始        |
      |                        |                    | 已被延迟，则为\ ``YES``\ ， |
      |                        |                    | 否则为\ ``NO``              |
      +------------------------+--------------------+-----------------------------+
      | ``enforced``           | ``yes_or_no``      | 适用于一种KingbaseES        |
      |                        |                    | 中不可用的特性（            |
      |                        |                    | 当前总是\ ``YES``\ ）       |
      +------------------------+--------------------+-----------------------------+
