pg_constraint

用于存储约束信息的系统表

pg_constraint 是一个用于存储约束信息(不包括 NOT NULL 约束)的 系统目录 表。

pg_constraint 添加于 PostgreSQL 7.3

用法

系统函数

系统函数 pg_get_constraintdef() 可用于获取约束的定义。

实现和可能的更改

NOT NULL 约束

PostgreSQL 17 之前,NOT NULL 约束存储在 pg_attribute 中。

域约束

提交 8abb3cda(来自 2015 年)包括一个建议,为 约束添加一个单独的表。

按 PostgreSQL 版本定义

pg_constraint (PostgreSQL 17)

                Table "pg_catalog.pg_constraint"
     Column     |     Type     | Collation | Nullable | Default 
----------------+--------------+-----------+----------+---------
 oid            | oid          |           | not null | 
 conname        | name         |           | not null | 
 connamespace   | oid          |           | not null | 
 contype        | "char"       |           | not null | 
 condeferrable  | boolean      |           | not null | 
 condeferred    | boolean      |           | not null | 
 convalidated   | boolean      |           | not null | 
 conrelid       | oid          |           | not null | 
 contypid       | oid          |           | not null | 
 conindid       | oid          |           | not null | 
 conparentid    | oid          |           | not null | 
 confrelid      | oid          |           | not null | 
 confupdtype    | "char"       |           | not null | 
 confdeltype    | "char"       |           | not null | 
 confmatchtype  | "char"       |           | not null | 
 conislocal     | boolean      |           | not null | 
 coninhcount    | smallint     |           | not null | 
 connoinherit   | boolean      |           | not null | 
 conperiod      | boolean      |           | not null | 
 conkey         | smallint[]   |           |          | 
 confkey        | smallint[]   |           |          | 
 conpfeqop      | oid[]        |           |          | 
 conppeqop      | oid[]        |           |          | 
 conffeqop      | oid[]        |           |          | 
 confdelsetcols | smallint[]   |           |          | 
 conexclop      | oid[]        |           |          | 
 conbin         | pg_node_tree | C         |          | 
Indexes:
    "pg_constraint_oid_index" PRIMARY KEY, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conparentid_index" btree (conparentid)
    "pg_constraint_conrelid_contypid_conname_index" UNIQUE CONSTRAINT, btree (conrelid, contypid, conname)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 16)

                Table "pg_catalog.pg_constraint"
     Column     |     Type     | Collation | Nullable | Default 
----------------+--------------+-----------+----------+---------
 oid            | oid          |           | not null | 
 conname        | name         |           | not null | 
 connamespace   | oid          |           | not null | 
 contype        | "char"       |           | not null | 
 condeferrable  | boolean      |           | not null | 
 condeferred    | boolean      |           | not null | 
 convalidated   | boolean      |           | not null | 
 conrelid       | oid          |           | not null | 
 contypid       | oid          |           | not null | 
 conindid       | oid          |           | not null | 
 conparentid    | oid          |           | not null | 
 confrelid      | oid          |           | not null | 
 confupdtype    | "char"       |           | not null | 
 confdeltype    | "char"       |           | not null | 
 confmatchtype  | "char"       |           | not null | 
 conislocal     | boolean      |           | not null | 
 coninhcount    | smallint     |           | not null | 
 connoinherit   | boolean      |           | not null | 
 conkey         | smallint[]   |           |          | 
 confkey        | smallint[]   |           |          | 
 conpfeqop      | oid[]        |           |          | 
 conppeqop      | oid[]        |           |          | 
 conffeqop      | oid[]        |           |          | 
 confdelsetcols | smallint[]   |           |          | 
 conexclop      | oid[]        |           |          | 
 conbin         | pg_node_tree | C         |          | 
Indexes:
    "pg_constraint_oid_index" PRIMARY KEY, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conparentid_index" btree (conparentid)
    "pg_constraint_conrelid_contypid_conname_index" UNIQUE CONSTRAINT, btree (conrelid, contypid, conname)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 15)

                Table "pg_catalog.pg_constraint"
     Column     |     Type     | Collation | Nullable | Default 
----------------+--------------+-----------+----------+---------
 oid            | oid          |           | not null | 
 conname        | name         |           | not null | 
 connamespace   | oid          |           | not null | 
 contype        | "char"       |           | not null | 
 condeferrable  | boolean      |           | not null | 
 condeferred    | boolean      |           | not null | 
 convalidated   | boolean      |           | not null | 
 conrelid       | oid          |           | not null | 
 contypid       | oid          |           | not null | 
 conindid       | oid          |           | not null | 
 conparentid    | oid          |           | not null | 
 confrelid      | oid          |           | not null | 
 confupdtype    | "char"       |           | not null | 
 confdeltype    | "char"       |           | not null | 
 confmatchtype  | "char"       |           | not null | 
 conislocal     | boolean      |           | not null | 
 coninhcount    | integer      |           | not null | 
 connoinherit   | boolean      |           | not null | 
 conkey         | smallint[]   |           |          | 
 confkey        | smallint[]   |           |          | 
 conpfeqop      | oid[]        |           |          | 
 conppeqop      | oid[]        |           |          | 
 conffeqop      | oid[]        |           |          | 
 confdelsetcols | smallint[]   |           |          | 
 conexclop      | oid[]        |           |          | 
 conbin         | pg_node_tree | C         |          | 
Indexes:
    "pg_constraint_oid_index" PRIMARY KEY, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conparentid_index" btree (conparentid)
    "pg_constraint_conrelid_contypid_conname_index" UNIQUE CONSTRAINT, btree (conrelid, contypid, conname)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 14)

               Table "pg_catalog.pg_constraint"
    Column     |     Type     | Collation | Nullable | Default 
---------------+--------------+-----------+----------+---------
 oid           | oid          |           | not null | 
 conname       | name         |           | not null | 
 connamespace  | oid          |           | not null | 
 contype       | "char"       |           | not null | 
 condeferrable | boolean      |           | not null | 
 condeferred   | boolean      |           | not null | 
 convalidated  | boolean      |           | not null | 
 conrelid      | oid          |           | not null | 
 contypid      | oid          |           | not null | 
 conindid      | oid          |           | not null | 
 conparentid   | oid          |           | not null | 
 confrelid     | oid          |           | not null | 
 confupdtype   | "char"       |           | not null | 
 confdeltype   | "char"       |           | not null | 
 confmatchtype | "char"       |           | not null | 
 conislocal    | boolean      |           | not null | 
 coninhcount   | integer      |           | not null | 
 connoinherit  | boolean      |           | not null | 
 conkey        | smallint[]   |           |          | 
 confkey       | smallint[]   |           |          | 
 conpfeqop     | oid[]        |           |          | 
 conppeqop     | oid[]        |           |          | 
 conffeqop     | oid[]        |           |          | 
 conexclop     | oid[]        |           |          | 
 conbin        | pg_node_tree | C         |          | 
Indexes:
    "pg_constraint_oid_index" PRIMARY KEY, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conparentid_index" btree (conparentid)
    "pg_constraint_conrelid_contypid_conname_index" UNIQUE CONSTRAINT, btree (conrelid, contypid, conname)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 13)

               Table "pg_catalog.pg_constraint"
    Column     |     Type     | Collation | Nullable | Default 
---------------+--------------+-----------+----------+---------
 oid           | oid          |           | not null | 
 conname       | name         |           | not null | 
 connamespace  | oid          |           | not null | 
 contype       | "char"       |           | not null | 
 condeferrable | boolean      |           | not null | 
 condeferred   | boolean      |           | not null | 
 convalidated  | boolean      |           | not null | 
 conrelid      | oid          |           | not null | 
 contypid      | oid          |           | not null | 
 conindid      | oid          |           | not null | 
 conparentid   | oid          |           | not null | 
 confrelid     | oid          |           | not null | 
 confupdtype   | "char"       |           | not null | 
 confdeltype   | "char"       |           | not null | 
 confmatchtype | "char"       |           | not null | 
 conislocal    | boolean      |           | not null | 
 coninhcount   | integer      |           | not null | 
 connoinherit  | boolean      |           | not null | 
 conkey        | smallint[]   |           |          | 
 confkey       | smallint[]   |           |          | 
 conpfeqop     | oid[]        |           |          | 
 conppeqop     | oid[]        |           |          | 
 conffeqop     | oid[]        |           |          | 
 conexclop     | oid[]        |           |          | 
 conbin        | pg_node_tree | C         |          | 
Indexes:
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conparentid_index" btree (conparentid)
    "pg_constraint_conrelid_contypid_conname_index" UNIQUE, btree (conrelid, contypid, conname)
    "pg_constraint_contypid_index" btree (contypid)
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 12)

               Table "pg_catalog.pg_constraint"
    Column     |     Type     | Collation | Nullable | Default 
---------------+--------------+-----------+----------+---------
 oid           | oid          |           | not null | 
 conname       | name         |           | not null | 
 connamespace  | oid          |           | not null | 
 contype       | "char"       |           | not null | 
 condeferrable | boolean      |           | not null | 
 condeferred   | boolean      |           | not null | 
 convalidated  | boolean      |           | not null | 
 conrelid      | oid          |           | not null | 
 contypid      | oid          |           | not null | 
 conindid      | oid          |           | not null | 
 conparentid   | oid          |           | not null | 
 confrelid     | oid          |           | not null | 
 confupdtype   | "char"       |           | not null | 
 confdeltype   | "char"       |           | not null | 
 confmatchtype | "char"       |           | not null | 
 conislocal    | boolean      |           | not null | 
 coninhcount   | integer      |           | not null | 
 connoinherit  | boolean      |           | not null | 
 conkey        | smallint[]   |           |          | 
 confkey       | smallint[]   |           |          | 
 conpfeqop     | oid[]        |           |          | 
 conppeqop     | oid[]        |           |          | 
 conffeqop     | oid[]        |           |          | 
 conexclop     | oid[]        |           |          | 
 conbin        | pg_node_tree | C         |          | 
Indexes:
    "pg_constraint_conrelid_contypid_conname_index" UNIQUE, btree (conrelid, contypid, conname)
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conparentid_index" btree (conparentid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 11)

               Table "pg_catalog.pg_constraint"
    Column     |     Type     | Collation | Nullable | Default 
---------------+--------------+-----------+----------+---------
 conname       | name         |           | not null | 
 connamespace  | oid          |           | not null | 
 contype       | "char"       |           | not null | 
 condeferrable | boolean      |           | not null | 
 condeferred   | boolean      |           | not null | 
 convalidated  | boolean      |           | not null | 
 conrelid      | oid          |           | not null | 
 contypid      | oid          |           | not null | 
 conindid      | oid          |           | not null | 
 conparentid   | oid          |           | not null | 
 confrelid     | oid          |           | not null | 
 confupdtype   | "char"       |           | not null | 
 confdeltype   | "char"       |           | not null | 
 confmatchtype | "char"       |           | not null | 
 conislocal    | boolean      |           | not null | 
 coninhcount   | integer      |           | not null | 
 connoinherit  | boolean      |           | not null | 
 conkey        | smallint[]   |           |          | 
 confkey       | smallint[]   |           |          | 
 conpfeqop     | oid[]        |           |          | 
 conppeqop     | oid[]        |           |          | 
 conffeqop     | oid[]        |           |          | 
 conexclop     | oid[]        |           |          | 
 conbin        | pg_node_tree |           |          | 
 consrc        | text         |           |          | 
Indexes:
    "pg_constraint_conrelid_contypid_conname_index" UNIQUE, btree (conrelid, contypid, conname)
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conparentid_index" btree (conparentid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 10)

               Table "pg_catalog.pg_constraint"
    Column     |     Type     | Collation | Nullable | Default 
---------------+--------------+-----------+----------+---------
 conname       | name         |           | not null | 
 connamespace  | oid          |           | not null | 
 contype       | "char"       |           | not null | 
 condeferrable | boolean      |           | not null | 
 condeferred   | boolean      |           | not null | 
 convalidated  | boolean      |           | not null | 
 conrelid      | oid          |           | not null | 
 contypid      | oid          |           | not null | 
 conindid      | oid          |           | not null | 
 confrelid     | oid          |           | not null | 
 confupdtype   | "char"       |           | not null | 
 confdeltype   | "char"       |           | not null | 
 confmatchtype | "char"       |           | not null | 
 conislocal    | boolean      |           | not null | 
 coninhcount   | integer      |           | not null | 
 connoinherit  | boolean      |           | not null | 
 conkey        | smallint[]   |           |          | 
 confkey       | smallint[]   |           |          | 
 conpfeqop     | oid[]        |           |          | 
 conppeqop     | oid[]        |           |          | 
 conffeqop     | oid[]        |           |          | 
 conexclop     | oid[]        |           |          | 
 conbin        | pg_node_tree |           |          | 
 consrc        | text         |           |          | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 9.6)

     Table "pg_catalog.pg_constraint"
    Column     |     Type     | Modifiers 
---------------+--------------+-----------
 conname       | name         | not null
 connamespace  | oid          | not null
 contype       | "char"       | not null
 condeferrable | boolean      | not null
 condeferred   | boolean      | not null
 convalidated  | boolean      | not null
 conrelid      | oid          | not null
 contypid      | oid          | not null
 conindid      | oid          | not null
 confrelid     | oid          | not null
 confupdtype   | "char"       | not null
 confdeltype   | "char"       | not null
 confmatchtype | "char"       | not null
 conislocal    | boolean      | not null
 coninhcount   | integer      | not null
 connoinherit  | boolean      | not null
 conkey        | smallint[]   | 
 confkey       | smallint[]   | 
 conpfeqop     | oid[]        | 
 conppeqop     | oid[]        | 
 conffeqop     | oid[]        | 
 conexclop     | oid[]        | 
 conbin        | pg_node_tree | 
 consrc        | text         | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 9.5)

     Table "pg_catalog.pg_constraint"
    Column     |     Type     | Modifiers 
---------------+--------------+-----------
 conname       | name         | not null
 connamespace  | oid          | not null
 contype       | "char"       | not null
 condeferrable | boolean      | not null
 condeferred   | boolean      | not null
 convalidated  | boolean      | not null
 conrelid      | oid          | not null
 contypid      | oid          | not null
 conindid      | oid          | not null
 confrelid     | oid          | not null
 confupdtype   | "char"       | not null
 confdeltype   | "char"       | not null
 confmatchtype | "char"       | not null
 conislocal    | boolean      | not null
 coninhcount   | integer      | not null
 connoinherit  | boolean      | not null
 conkey        | smallint[]   | 
 confkey       | smallint[]   | 
 conpfeqop     | oid[]        | 
 conppeqop     | oid[]        | 
 conffeqop     | oid[]        | 
 conexclop     | oid[]        | 
 conbin        | pg_node_tree | 
 consrc        | text         | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 9.4)

     Table "pg_catalog.pg_constraint"
    Column     |     Type     | Modifiers 
---------------+--------------+-----------
 conname       | name         | not null
 connamespace  | oid          | not null
 contype       | "char"       | not null
 condeferrable | boolean      | not null
 condeferred   | boolean      | not null
 convalidated  | boolean      | not null
 conrelid      | oid          | not null
 contypid      | oid          | not null
 conindid      | oid          | not null
 confrelid     | oid          | not null
 confupdtype   | "char"       | not null
 confdeltype   | "char"       | not null
 confmatchtype | "char"       | not null
 conislocal    | boolean      | not null
 coninhcount   | integer      | not null
 connoinherit  | boolean      | not null
 conkey        | smallint[]   | 
 confkey       | smallint[]   | 
 conpfeqop     | oid[]        | 
 conppeqop     | oid[]        | 
 conffeqop     | oid[]        | 
 conexclop     | oid[]        | 
 conbin        | pg_node_tree | 
 consrc        | text         | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 9.3)

     Table "pg_catalog.pg_constraint"
    Column     |     Type     | Modifiers 
---------------+--------------+-----------
 conname       | name         | not null
 connamespace  | oid          | not null
 contype       | "char"       | not null
 condeferrable | boolean      | not null
 condeferred   | boolean      | not null
 convalidated  | boolean      | not null
 conrelid      | oid          | not null
 contypid      | oid          | not null
 conindid      | oid          | not null
 confrelid     | oid          | not null
 confupdtype   | "char"       | not null
 confdeltype   | "char"       | not null
 confmatchtype | "char"       | not null
 conislocal    | boolean      | not null
 coninhcount   | integer      | not null
 connoinherit  | boolean      | not null
 conkey        | smallint[]   | 
 confkey       | smallint[]   | 
 conpfeqop     | oid[]        | 
 conppeqop     | oid[]        | 
 conffeqop     | oid[]        | 
 conexclop     | oid[]        | 
 conbin        | pg_node_tree | 
 consrc        | text         | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 9.2)

     Table "pg_catalog.pg_constraint"
    Column     |     Type     | Modifiers 
---------------+--------------+-----------
 conname       | name         | not null
 connamespace  | oid          | not null
 contype       | "char"       | not null
 condeferrable | boolean      | not null
 condeferred   | boolean      | not null
 convalidated  | boolean      | not null
 conrelid      | oid          | not null
 contypid      | oid          | not null
 conindid      | oid          | not null
 confrelid     | oid          | not null
 confupdtype   | "char"       | not null
 confdeltype   | "char"       | not null
 confmatchtype | "char"       | not null
 conislocal    | boolean      | not null
 coninhcount   | integer      | not null
 connoinherit  | boolean      | not null
 conkey        | smallint[]   | 
 confkey       | smallint[]   | 
 conpfeqop     | oid[]        | 
 conppeqop     | oid[]        | 
 conffeqop     | oid[]        | 
 conexclop     | oid[]        | 
 conbin        | pg_node_tree | 
 consrc        | text         | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 9.1)

     Table "pg_catalog.pg_constraint"
    Column     |     Type     | Modifiers 
---------------+--------------+-----------
 conname       | name         | not null
 connamespace  | oid          | not null
 contype       | "char"       | not null
 condeferrable | boolean      | not null
 condeferred   | boolean      | not null
 convalidated  | boolean      | not null
 conrelid      | oid          | not null
 contypid      | oid          | not null
 conindid      | oid          | not null
 confrelid     | oid          | not null
 confupdtype   | "char"       | not null
 confdeltype   | "char"       | not null
 confmatchtype | "char"       | not null
 conislocal    | boolean      | not null
 coninhcount   | integer      | not null
 conkey        | smallint[]   | 
 confkey       | smallint[]   | 
 conpfeqop     | oid[]        | 
 conppeqop     | oid[]        | 
 conffeqop     | oid[]        | 
 conexclop     | oid[]        | 
 conbin        | pg_node_tree | 
 consrc        | text         | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 9.0)

    Table "pg_catalog.pg_constraint"
    Column     |    Type    | Modifiers 
---------------+------------+-----------
 conname       | name       | not null
 connamespace  | oid        | not null
 contype       | "char"     | not null
 condeferrable | boolean    | not null
 condeferred   | boolean    | not null
 conrelid      | oid        | not null
 contypid      | oid        | not null
 conindid      | oid        | not null
 confrelid     | oid        | not null
 confupdtype   | "char"     | not null
 confdeltype   | "char"     | not null
 confmatchtype | "char"     | not null
 conislocal    | boolean    | not null
 coninhcount   | integer    | not null
 conkey        | smallint[] | 
 confkey       | smallint[] | 
 conpfeqop     | oid[]      | 
 conppeqop     | oid[]      | 
 conffeqop     | oid[]      | 
 conexclop     | oid[]      | 
 conbin        | text       | 
 consrc        | text       | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 8.4)

    Table "pg_catalog.pg_constraint"
    Column     |    Type    | Modifiers 
---------------+------------+-----------
 conname       | name       | not null
 connamespace  | oid        | not null
 contype       | "char"     | not null
 condeferrable | boolean    | not null
 condeferred   | boolean    | not null
 conrelid      | oid        | not null
 contypid      | oid        | not null
 confrelid     | oid        | not null
 confupdtype   | "char"     | not null
 confdeltype   | "char"     | not null
 confmatchtype | "char"     | not null
 conislocal    | boolean    | not null
 coninhcount   | integer    | not null
 conkey        | smallint[] | 
 confkey       | smallint[] | 
 conpfeqop     | oid[]      | 
 conppeqop     | oid[]      | 
 conffeqop     | oid[]      | 
 conbin        | text       | 
 consrc        | text       | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 8.3)

    Table "pg_catalog.pg_constraint"
    Column     |    Type    | Modifiers 
---------------+------------+-----------
 conname       | name       | not null
 connamespace  | oid        | not null
 contype       | "char"     | not null
 condeferrable | boolean    | not null
 condeferred   | boolean    | not null
 conrelid      | oid        | not null
 contypid      | oid        | not null
 confrelid     | oid        | not null
 confupdtype   | "char"     | not null
 confdeltype   | "char"     | not null
 confmatchtype | "char"     | not null
 conkey        | smallint[] | 
 confkey       | smallint[] | 
 conpfeqop     | oid[]      | 
 conppeqop     | oid[]      | 
 conffeqop     | oid[]      | 
 conbin        | text       | 
 consrc        | text       | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

pg_constraint (PostgreSQL 8.2)

    Table "pg_catalog.pg_constraint"
    Column     |    Type    | Modifiers 
---------------+------------+-----------
 conname       | name       | not null
 connamespace  | oid        | not null
 contype       | "char"     | not null
 condeferrable | boolean    | not null
 condeferred   | boolean    | not null
 conrelid      | oid        | not null
 contypid      | oid        | not null
 confrelid     | oid        | not null
 confupdtype   | "char"     | not null
 confdeltype   | "char"     | not null
 confmatchtype | "char"     | not null
 conkey        | smallint[] | 
 confkey       | smallint[] | 
 conbin        | text       | 
 consrc        | text       | 
Indexes:
    "pg_constraint_oid_index" UNIQUE, btree (oid)
    "pg_constraint_conname_nsp_index" btree (conname, connamespace)
    "pg_constraint_conrelid_index" btree (conrelid)
    "pg_constraint_contypid_index" btree (contypid)
    

文档: pg_constraint

更改历史记录

分类

系统目录

另请参见

pg_attributepg_dependpg_get_constraintdef()

反馈

提交关于“pg_constraint”的任何评论、建议或更正 此处