Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/create_opclass.sgml`
d52bf016c37813b9d55d680a1d6edddf190bf52f2210eea30000000100000fa3
 form a self-consistent set.  It is the user's
   responsibility to define a valid operator class.
  </para>

  <para>
   Related operator classes can be grouped into <firstterm>operator
   families</firstterm>.  To add a new operator class to an existing family,
   specify the <literal>FAMILY</literal> option in <command>CREATE OPERATOR
   CLASS</command>.  Without this option, the new class is placed into
   a family named the same as the new class (creating that family if
   it doesn't already exist).
  </para>

  <para>
   Refer to <xref linkend="xindex"/> for further information.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="parameter">name</replaceable></term>
    <listitem>
     <para>
      The name of the operator class to be created.  The name can be
      schema-qualified.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>DEFAULT</literal></term>
    <listitem>
     <para>
      If present, the operator class will become the default
      operator class for its data type.  At most one operator class
      can be the default for a specific data type and index method.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">data_type</replaceable></term>
    <listitem>
     <para>
      The column data type that this operator class is for.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">index_method</replaceable></term>
    <listitem>
     <para>
      The name of the index method this operator class is for.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">family_name</replaceable></term>
    <listitem>
     <para>
      The name of the existing operator family to add this operator class to.
      If not specified, a family named the same as the operator class is
      used (creating it, if it doesn't already exist).
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">strategy_number</replaceable></term>
    <listitem>
     <para>
      The index method's strategy number for an operator
      associated with the operator class.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">operator_name</replaceable></term>
    <listitem>
     <para>
      The name (optionally schema-qualified) of an operator associated
      with the operator class.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">op_type</replaceable></term>
    <listitem>
     <para>
      In an <literal>OPERATOR</literal> clause,
      the operand data type(s) of the operator, or <literal>NONE</literal> to
      signify a prefix operator.  The operand data
      types can be omitted in the normal case where they are the same
      as the operator class's data type.
     </para>

     <para>
      In a <literal>FUNCTION</literal> clause, the operand data type(s) the
      function is intended to support, if different from
      the input data type(s) of the function (for B-tree comparison functions
      and hash functions)
      or the class's data type (for B-tree sort support functions,
      B-tree equal image functions, and all functions in GiST,
      SP-GiST, GIN and BRIN operator classes).  These defaults are
      correct, and so <replaceable
       class="parameter">op_type</replaceable> need not be specified
      in <literal>FUNCTION</literal> clauses, except for the case of a
      B-tree sort support function that is meant to support
      cross-data-type comparisons.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">sort_family_name</replaceable></term>
    <listitem>
     <para>
      The name (optionally schema-qualified) of an existing

Title: CREATE OPERATOR CLASS Parameters
Summary
This section details the parameters for the CREATE OPERATOR CLASS command in PostgreSQL. It covers the operator class name, the DEFAULT option to set the class as default, the data type the class is for, the index method, and the operator family. It also includes parameters for defining operators and functions within the class, such as strategy numbers, operator names, operand data types (op_type), and sort family names for ordering.