Home Explore Blog CI



postgresql

11th chunk of `doc/src/sgml/catalogs.sgml`
7299ac9d1f2ac81b43f9a253e76d651961f5c7c51fd018c00000000100000fa4
 linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       OID of the operator
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>amopmethod</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-am"><structname>pg_am</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       Index access method operator family is for
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>amopsortfamily</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The B-tree operator family this entry sorts according to, if an
       ordering operator; zero if a search operator
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   A <quote>search</quote> operator entry indicates that an index of this operator
   family can be searched to find all rows satisfying
   <literal>WHERE</literal>
   <replaceable>indexed_column</replaceable>
   <replaceable>operator</replaceable>
   <replaceable>constant</replaceable>.
   Obviously, such an operator must return <type>boolean</type>, and its left-hand input
   type must match the index's column data type.
  </para>

  <para>
   An <quote>ordering</quote> operator entry indicates that an index of this
   operator family can be scanned to return rows in the order represented by
   <literal>ORDER BY</literal>
   <replaceable>indexed_column</replaceable>
   <replaceable>operator</replaceable>
   <replaceable>constant</replaceable>.
   Such an operator could return any sortable data type, though again
   its left-hand input type must match the index's column data type.
   The exact semantics of the <literal>ORDER BY</literal> are specified by the
   <structfield>amopsortfamily</structfield> column, which must reference
   a B-tree operator family for the operator's result type.
  </para>

  <note>
   <para>
    At present, it's assumed that the sort order for an ordering operator
    is the default for the referenced operator family, i.e., <literal>ASC NULLS
    LAST</literal>.  This might someday be relaxed by adding additional columns
    to specify sort options explicitly.
   </para>
  </note>

  <para>
   An entry's <structfield>amopmethod</structfield> must match the
   <structfield>opfmethod</structfield> of its containing operator family (including
   <structfield>amopmethod</structfield> here is an intentional denormalization of the
   catalog structure for performance reasons).  Also,
   <structfield>amoplefttype</structfield> and <structfield>amoprighttype</structfield> must match
   the <structfield>oprleft</structfield> and <structfield>oprright</structfield> fields of the
   referenced <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link> entry.
  </para>

 </sect1>


 <sect1 id="catalog-pg-amproc">
  <title><structname>pg_amproc</structname></title>

  <indexterm zone="catalog-pg-amproc">
   <primary>pg_amproc</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_amproc</structname> stores information about
   support functions associated with access method operator families.  There
   is one row for each support function belonging to an operator family.
  </para>

  <table>
   <title><structname>pg_amproc</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>oid</structfield> <type>oid</type>

Title: pg_amop Columns Explained and pg_amproc Introduction
Summary
This section continues the description of the pg_amop catalog table columns: amopopr (OID of the operator), amopmethod (index access method), and amopsortfamily (B-tree operator family for ordering). It explains 'search' and 'ordering' operator entries and their requirements. It also introduces the pg_amproc catalog table, which stores information about support functions associated with access method operator families.