codekingpro/portable-devtools
115k
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!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">3CREATE OPERATOR FAMILY <em class="replaceable"><code>name</code></em> USING <em class="replaceable"><code>index_method</code></em>4</pre></div><div class="refsect1" id="id-1.9.3.74.5"><h2>Description</h2><p>5 <code class="command">CREATE OPERATOR FAMILY</code> creates a new operator family.6 An operator family defines a collection of related operator classes,7 and perhaps some additional operators and support functions that are8 compatible with these operator classes but not essential for the9 functioning of any individual index. (Operators and functions that10 are essential to indexes should be grouped within the relevant operator11 class, rather than being <span class="quote">“<span class="quote">loose</span>”</span> in the operator family.12 Typically, single-data-type operators are bound to operator classes,13 while cross-data-type operators can be loose in an operator family14 containing operator classes for both data types.)15 </p><p>16 The new operator family is initially empty. It should be populated17 by issuing subsequent <code class="command">CREATE OPERATOR CLASS</code> commands18 to add contained operator classes, and optionally19 <code class="command">ALTER OPERATOR FAMILY</code> commands to add <span class="quote">“<span class="quote">loose</span>”</span>20 operators and their corresponding support functions.21 </p><p>22 If a schema name is given then the operator family is created in the23 specified schema. Otherwise it is created in the current schema.24 Two operator families in the same schema can have the same name only if they25 are for different index methods.26 </p><p>27 The user who defines an operator family becomes its owner. Presently,28 the creating user must be a superuser. (This restriction is made because29 an erroneous operator family definition could confuse or even crash the30 server.)31 </p><p>32 Refer to <a class="xref" href="xindex.html" title="38.16. Interfacing Extensions to Indexes">Section 38.16</a> for further information.33 </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>34 The name of the operator family to be created. The name can be35 schema-qualified.36 </p></dd><dt><span class="term"><em class="replaceable"><code>index_method</code></em></span></dt><dd><p>37 The name of the index method this operator family is for.38 </p></dd></dl></div></div><div class="refsect1" id="id-1.9.3.74.7"><h2>Compatibility</h2><p>39 <code class="command">CREATE OPERATOR FAMILY</code> is a40 <span class="productname">PostgreSQL</span> extension. There is no41 <code class="command">CREATE OPERATOR FAMILY</code> statement in the SQL42 standard.43 </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>