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