summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/html/sql-createopfamily.html
blob: a3c42d394e832aabe239340f2a7e7b2cc0c1ab29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>CREATE OPERATOR FAMILY</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="sql-createopclass.html" title="CREATE OPERATOR CLASS" /><link rel="next" href="sql-createpolicy.html" title="CREATE POLICY" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">CREATE OPERATOR FAMILY</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="sql-createopclass.html" title="CREATE OPERATOR CLASS">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><th width="60%" align="center">SQL Commands</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="sql-createpolicy.html" title="CREATE POLICY">Next</a></td></tr></table><hr /></div><div class="refentry" id="SQL-CREATEOPFAMILY"><div class="titlepage"></div><a id="id-1.9.3.74.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">CREATE OPERATOR FAMILY</span></h2><p>CREATE OPERATOR FAMILY — define a new operator family</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
CREATE OPERATOR FAMILY <em class="replaceable"><code>name</code></em> USING <em class="replaceable"><code>index_method</code></em>
</pre></div><div class="refsect1" id="id-1.9.3.74.5"><h2>Description</h2><p>
   <code class="command">CREATE OPERATOR FAMILY</code> creates a new operator family.
   An operator family defines a collection of related operator classes,
   and perhaps some additional operators and support functions that are
   compatible with these operator classes but not essential for the
   functioning of any individual index.  (Operators and functions that
   are essential to indexes should be grouped within the relevant operator
   class, rather than being <span class="quote"><span class="quote">loose</span></span> in the operator family.
   Typically, single-data-type operators are bound to operator classes,
   while cross-data-type operators can be loose in an operator family
   containing operator classes for both data types.)
  </p><p>
   The new operator family is initially empty.  It should be populated
   by issuing subsequent <code class="command">CREATE OPERATOR CLASS</code> commands
   to add contained operator classes, and optionally
   <code class="command">ALTER OPERATOR FAMILY</code> commands to add <span class="quote"><span class="quote">loose</span></span>
   operators and their corresponding support functions.
  </p><p>
   If a schema name is given then the operator family is created in the
   specified schema.  Otherwise it is created in the current schema.
   Two operator families in the same schema can have the same name only if they
   are for different index methods.
  </p><p>
   The user who defines an operator family becomes its owner.  Presently,
   the creating user must be a superuser.  (This restriction is made because
   an erroneous operator family definition could confuse or even crash the
   server.)
  </p><p>
   Refer to <a class="xref" href="xindex.html" title="38.16. Interfacing Extensions to Indexes">Section 38.16</a> for further information.
  </p></div><div class="refsect1" id="id-1.9.3.74.6"><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>name</code></em></span></dt><dd><p>
      The name of the operator family to be created.  The name can be
      schema-qualified.
     </p></dd><dt><span class="term"><em class="replaceable"><code>index_method</code></em></span></dt><dd><p>
      The name of the index method this operator family is for.
     </p></dd></dl></div></div><div class="refsect1" id="id-1.9.3.74.7"><h2>Compatibility</h2><p>
   <code class="command">CREATE OPERATOR FAMILY</code> is a
   <span class="productname">PostgreSQL</span> extension.  There is no
   <code class="command">CREATE OPERATOR FAMILY</code> statement in the SQL
   standard.
  </p></div><div class="refsect1" id="id-1.9.3.74.8"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-alteropfamily.html" title="ALTER OPERATOR FAMILY"><span class="refentrytitle">ALTER OPERATOR FAMILY</span></a>, <a class="xref" href="sql-dropopfamily.html" title="DROP OPERATOR FAMILY"><span class="refentrytitle">DROP OPERATOR FAMILY</span></a>, <a class="xref" href="sql-createopclass.html" title="CREATE OPERATOR CLASS"><span class="refentrytitle">CREATE OPERATOR CLASS</span></a>, <a class="xref" href="sql-alteropclass.html" title="ALTER OPERATOR CLASS"><span class="refentrytitle">ALTER OPERATOR CLASS</span></a>, <a class="xref" href="sql-dropopclass.html" title="DROP OPERATOR CLASS"><span class="refentrytitle">DROP OPERATOR CLASS</span></a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sql-createopclass.html" title="CREATE OPERATOR CLASS">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sql-createpolicy.html" title="CREATE POLICY">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CREATE OPERATOR CLASS </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> CREATE POLICY</td></tr></table></div></body></html>