????
Current Path : C:/opt/pgsql/doc/postgresql/html/ |
Current File : C:/opt/pgsql/doc/postgresql/html/catalog-pg-amop.html |
<?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>53.4. pg_amop</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="catalog-pg-am.html" title="53.3. pg_am" /><link rel="next" href="catalog-pg-amproc.html" title="53.5. pg_amproc" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">53.4. <code class="structname">pg_amop</code></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="catalog-pg-am.html" title="53.3. pg_am">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="Chapter 53. System Catalogs">Up</a></td><th width="60%" align="center">Chapter 53. System Catalogs</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="catalog-pg-amproc.html" title="53.5. pg_amproc">Next</a></td></tr></table><hr /></div><div class="sect1" id="CATALOG-PG-AMOP"><div class="titlepage"><div><div><h2 class="title" style="clear: both">53.4. <code class="structname">pg_amop</code> <a href="#CATALOG-PG-AMOP" class="id_link">#</a></h2></div></div></div><a id="id-1.10.4.6.2" class="indexterm"></a><p> The catalog <code class="structname">pg_amop</code> stores information about operators associated with access method operator families. There is one row for each operator that is a member of an operator family. A family member can be either a <em class="firstterm">search</em> operator or an <em class="firstterm">ordering</em> operator. An operator can appear in more than one family, but cannot appear in more than one search position nor more than one ordering position within a family. (It is allowed, though unlikely, for an operator to be used for both search and ordering purposes.) </p><div class="table" id="id-1.10.4.6.4"><p class="title"><strong>Table 53.4. <code class="structname">pg_amop</code> Columns</strong></p><div class="table-contents"><table class="table" summary="pg_amop Columns" border="1"><colgroup><col /></colgroup><thead><tr><th class="catalog_table_entry"><p class="column_definition"> Column Type </p> <p> Description </p></th></tr></thead><tbody><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">oid</code> <code class="type">oid</code> </p> <p> Row identifier </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">amopfamily</code> <code class="type">oid</code> (references <a class="link" href="catalog-pg-opfamily.html" title="53.35. pg_opfamily"><code class="structname">pg_opfamily</code></a>.<code class="structfield">oid</code>) </p> <p> The operator family this entry is for </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">amoplefttype</code> <code class="type">oid</code> (references <a class="link" href="catalog-pg-type.html" title="53.64. pg_type"><code class="structname">pg_type</code></a>.<code class="structfield">oid</code>) </p> <p> Left-hand input data type of operator </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">amoprighttype</code> <code class="type">oid</code> (references <a class="link" href="catalog-pg-type.html" title="53.64. pg_type"><code class="structname">pg_type</code></a>.<code class="structfield">oid</code>) </p> <p> Right-hand input data type of operator </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">amopstrategy</code> <code class="type">int2</code> </p> <p> Operator strategy number </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">amoppurpose</code> <code class="type">char</code> </p> <p> Operator purpose, either <code class="literal">s</code> for search or <code class="literal">o</code> for ordering </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">amopopr</code> <code class="type">oid</code> (references <a class="link" href="catalog-pg-operator.html" title="53.34. pg_operator"><code class="structname">pg_operator</code></a>.<code class="structfield">oid</code>) </p> <p> OID of the operator </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">amopmethod</code> <code class="type">oid</code> (references <a class="link" href="catalog-pg-am.html" title="53.3. pg_am"><code class="structname">pg_am</code></a>.<code class="structfield">oid</code>) </p> <p> Index access method operator family is for </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition"> <code class="structfield">amopsortfamily</code> <code class="type">oid</code> (references <a class="link" href="catalog-pg-opfamily.html" title="53.35. pg_opfamily"><code class="structname">pg_opfamily</code></a>.<code class="structfield">oid</code>) </p> <p> The B-tree operator family this entry sorts according to, if an ordering operator; zero if a search operator </p></td></tr></tbody></table></div></div><br class="table-break" /><p> A <span class="quote">“<span class="quote">search</span>”</span> operator entry indicates that an index of this operator family can be searched to find all rows satisfying <code class="literal">WHERE</code> <em class="replaceable"><code>indexed_column</code></em> <em class="replaceable"><code>operator</code></em> <em class="replaceable"><code>constant</code></em>. Obviously, such an operator must return <code class="type">boolean</code>, and its left-hand input type must match the index's column data type. </p><p> An <span class="quote">“<span class="quote">ordering</span>”</span> operator entry indicates that an index of this operator family can be scanned to return rows in the order represented by <code class="literal">ORDER BY</code> <em class="replaceable"><code>indexed_column</code></em> <em class="replaceable"><code>operator</code></em> <em class="replaceable"><code>constant</code></em>. 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 <code class="literal">ORDER BY</code> are specified by the <code class="structfield">amopsortfamily</code> column, which must reference a B-tree operator family for the operator's result type. </p><div class="note"><h3 class="title">Note</h3><p> At present, it's assumed that the sort order for an ordering operator is the default for the referenced operator family, i.e., <code class="literal">ASC NULLS LAST</code>. This might someday be relaxed by adding additional columns to specify sort options explicitly. </p></div><p> An entry's <code class="structfield">amopmethod</code> must match the <code class="structfield">opfmethod</code> of its containing operator family (including <code class="structfield">amopmethod</code> here is an intentional denormalization of the catalog structure for performance reasons). Also, <code class="structfield">amoplefttype</code> and <code class="structfield">amoprighttype</code> must match the <code class="structfield">oprleft</code> and <code class="structfield">oprright</code> fields of the referenced <a class="link" href="catalog-pg-operator.html" title="53.34. pg_operator"><code class="structname">pg_operator</code></a> entry. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="catalog-pg-am.html" title="53.3. pg_am">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="catalogs.html" title="Chapter 53. System Catalogs">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="catalog-pg-amproc.html" title="53.5. pg_amproc">Next</a></td></tr><tr><td width="40%" align="left" valign="top">53.3. <code class="structname">pg_am</code> </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"> 53.5. <code class="structname">pg_amproc</code></td></tr></table></div></body></html>