Home Explore Blog CI



postgresql

34th chunk of `doc/src/sgml/catalogs.sgml`
ca4da9807f0e77f147e90f5d4336bcf329c65aaf8212f0ea0000000100000fbd
 <type>int2[]</type>
       (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>)
      </para>
      <para>
       If a table constraint (including foreign keys, but not constraint
       triggers), list of the constrained columns
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>confkey</structfield> <type>int2[]</type>
       (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>)
      </para>
      <para>
       If a foreign key, list of the referenced columns
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>conpfeqop</structfield> <type>oid[]</type>
       (references <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       If a foreign key, list of the equality operators for PK = FK comparisons
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>conppeqop</structfield> <type>oid[]</type>
       (references <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       If a foreign key, list of the equality operators for PK = PK comparisons
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>conffeqop</structfield> <type>oid[]</type>
       (references <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       If a foreign key, list of the equality operators for FK = FK comparisons
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>confdelsetcols</structfield> <type>int2[]</type>
       (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>)
      </para>
      <para>
       If a foreign key with a <literal>SET NULL</literal> or <literal>SET
       DEFAULT</literal> delete action, the columns that will be updated.
       If null, all of the referencing columns will be updated.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>conexclop</structfield> <type>oid[]</type>
       (references <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       If an exclusion constraint or <literal>WITHOUT OVERLAPS</literal>
       primary key/unique constraint, list of the per-column exclusion operators.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>conbin</structfield> <type>pg_node_tree</type>
      </para>
      <para>
       If a check constraint, an internal representation of the
       expression.  (It's recommended to use
       <function>pg_get_constraintdef()</function> to extract the definition of
       a check constraint.)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   In the case of an exclusion constraint, <structfield>conkey</structfield>
   is only useful for constraint elements that are simple column references.
   For other cases, a zero appears in <structfield>conkey</structfield>
   and the associated index must be consulted to discover the expression
   that is constrained.  (<structfield>conkey</structfield> thus has the
   same contents as <link linkend="catalog-pg-index"><structname>pg_index</structname></link>.<structfield>indkey</structfield>

Title: pg_constraint Catalog Columns: Foreign Key and Exclusion Constraints
Summary
This section details additional columns in the pg_constraint catalog table, focusing on foreign key equality operators (conpfeqop, conppeqop, conffeqop), columns updated by SET NULL/SET DEFAULT actions (confdelsetcols), exclusion operators (conexclop) for exclusion constraints, and the internal representation of check constraints (conbin). It also clarifies the usage of conkey for exclusion constraints and its relation to pg_index.indkey.