Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 9b6cc37ce608401d44f6535a0c7cb777 > files > 287

postgresql11-docs-11.5-1.mga7.noarch.rpm

<?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>Chapter 38. Extending SQL</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="server-programming.html" title="Part V. Server Programming" /><link rel="next" href="extend-how.html" title="38.1. How Extensibility Works" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">Chapter 38. Extending <acronym xmlns="http://www.w3.org/1999/xhtml" class="acronym">SQL</acronym></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="server-programming.html" title="Part V. Server Programming">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="server-programming.html" title="Part V. Server Programming">Up</a></td><th width="60%" align="center">Part V. Server Programming</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 11.5 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="extend-how.html" title="38.1. How Extensibility Works">Next</a></td></tr></table><hr></hr></div><div class="chapter" id="EXTEND"><div class="titlepage"><div><div><h2 class="title">Chapter 38. Extending <acronym class="acronym">SQL</acronym></h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="extend-how.html">38.1. How Extensibility Works</a></span></dt><dt><span class="sect1"><a href="extend-type-system.html">38.2. The <span class="productname">PostgreSQL</span> Type System</a></span></dt><dd><dl><dt><span class="sect2"><a href="extend-type-system.html#id-1.8.3.5.9">38.2.1. Base Types</a></span></dt><dt><span class="sect2"><a href="extend-type-system.html#id-1.8.3.5.10">38.2.2. Container Types</a></span></dt><dt><span class="sect2"><a href="extend-type-system.html#EXTEND-TYPE-SYSTEM-DOMAINS">38.2.3. Domains</a></span></dt><dt><span class="sect2"><a href="extend-type-system.html#id-1.8.3.5.12">38.2.4. Pseudo-Types</a></span></dt><dt><span class="sect2"><a href="extend-type-system.html#EXTEND-TYPES-POLYMORPHIC">38.2.5. Polymorphic Types</a></span></dt></dl></dd><dt><span class="sect1"><a href="xfunc.html">38.3. User-defined Functions</a></span></dt><dt><span class="sect1"><a href="xproc.html">38.4. User-defined Procedures</a></span></dt><dt><span class="sect1"><a href="xfunc-sql.html">38.5. Query Language (<acronym class="acronym">SQL</acronym>) Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-SQL-FUNCTION-ARGUMENTS">38.5.1. Arguments for <acronym class="acronym">SQL</acronym> Functions</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-SQL-BASE-FUNCTIONS">38.5.2. <acronym class="acronym">SQL</acronym> Functions on Base Types</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-SQL-COMPOSITE-FUNCTIONS">38.5.3. <acronym class="acronym">SQL</acronym> Functions on Composite Types</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-OUTPUT-PARAMETERS">38.5.4. <acronym class="acronym">SQL</acronym> Functions with Output Parameters</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-SQL-VARIADIC-FUNCTIONS">38.5.5. <acronym class="acronym">SQL</acronym> Functions with Variable Numbers of Arguments</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-SQL-PARAMETER-DEFAULTS">38.5.6. <acronym class="acronym">SQL</acronym> Functions with Default Values for Arguments</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-SQL-TABLE-FUNCTIONS">38.5.7. <acronym class="acronym">SQL</acronym> Functions as Table Sources</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-SQL-FUNCTIONS-RETURNING-SET">38.5.8. <acronym class="acronym">SQL</acronym> Functions Returning Sets</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#XFUNC-SQL-FUNCTIONS-RETURNING-TABLE">38.5.9. <acronym class="acronym">SQL</acronym> Functions Returning <code class="literal">TABLE</code></a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#id-1.8.3.8.18">38.5.10. Polymorphic <acronym class="acronym">SQL</acronym> Functions</a></span></dt><dt><span class="sect2"><a href="xfunc-sql.html#id-1.8.3.8.19">38.5.11. <acronym class="acronym">SQL</acronym> Functions with Collations</a></span></dt></dl></dd><dt><span class="sect1"><a href="xfunc-overload.html">38.6. Function Overloading</a></span></dt><dt><span class="sect1"><a href="xfunc-volatility.html">38.7. Function Volatility Categories</a></span></dt><dt><span class="sect1"><a href="xfunc-pl.html">38.8. Procedural Language Functions</a></span></dt><dt><span class="sect1"><a href="xfunc-internal.html">38.9. Internal Functions</a></span></dt><dt><span class="sect1"><a href="xfunc-c.html">38.10. C-Language Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="xfunc-c.html#XFUNC-C-DYNLOAD">38.10.1. Dynamic Loading</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#XFUNC-C-BASETYPE">38.10.2. Base Types in C-Language Functions</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#id-1.8.3.13.7">38.10.3. Version 1 Calling Conventions</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#id-1.8.3.13.8">38.10.4. Writing Code</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#DFUNC">38.10.5. Compiling and Linking Dynamically-loaded Functions</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#id-1.8.3.13.10">38.10.6. Composite-type Arguments</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#id-1.8.3.13.11">38.10.7. Returning Rows (Composite Types)</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#XFUNC-C-RETURN-SET">38.10.8. Returning Sets</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#id-1.8.3.13.13">38.10.9. Polymorphic Arguments and Return Types</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#XFUNC-TRANSFORM-FUNCTIONS">38.10.10. Transform Functions</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#id-1.8.3.13.15">38.10.11. Shared Memory and LWLocks</a></span></dt><dt><span class="sect2"><a href="xfunc-c.html#EXTEND-CPP">38.10.12. Using C++ for Extensibility</a></span></dt></dl></dd><dt><span class="sect1"><a href="xaggr.html">38.11. User-defined Aggregates</a></span></dt><dd><dl><dt><span class="sect2"><a href="xaggr.html#XAGGR-MOVING-AGGREGATES">38.11.1. Moving-Aggregate Mode</a></span></dt><dt><span class="sect2"><a href="xaggr.html#XAGGR-POLYMORPHIC-AGGREGATES">38.11.2. Polymorphic and Variadic Aggregates</a></span></dt><dt><span class="sect2"><a href="xaggr.html#XAGGR-ORDERED-SET-AGGREGATES">38.11.3. Ordered-Set Aggregates</a></span></dt><dt><span class="sect2"><a href="xaggr.html#XAGGR-PARTIAL-AGGREGATES">38.11.4. Partial Aggregation</a></span></dt><dt><span class="sect2"><a href="xaggr.html#XAGGR-SUPPORT-FUNCTIONS">38.11.5. Support Functions for Aggregates</a></span></dt></dl></dd><dt><span class="sect1"><a href="xtypes.html">38.12. User-defined Types</a></span></dt><dd><dl><dt><span class="sect2"><a href="xtypes.html#XTYPES-TOAST">38.12.1. TOAST Considerations</a></span></dt></dl></dd><dt><span class="sect1"><a href="xoper.html">38.13. User-defined Operators</a></span></dt><dt><span class="sect1"><a href="xoper-optimization.html">38.14. Operator Optimization Information</a></span></dt><dd><dl><dt><span class="sect2"><a href="xoper-optimization.html#id-1.8.3.17.4">38.14.1. <code class="literal">COMMUTATOR</code></a></span></dt><dt><span class="sect2"><a href="xoper-optimization.html#id-1.8.3.17.5">38.14.2. <code class="literal">NEGATOR</code></a></span></dt><dt><span class="sect2"><a href="xoper-optimization.html#id-1.8.3.17.6">38.14.3. <code class="literal">RESTRICT</code></a></span></dt><dt><span class="sect2"><a href="xoper-optimization.html#id-1.8.3.17.7">38.14.4. <code class="literal">JOIN</code></a></span></dt><dt><span class="sect2"><a href="xoper-optimization.html#id-1.8.3.17.8">38.14.5. <code class="literal">HASHES</code></a></span></dt><dt><span class="sect2"><a href="xoper-optimization.html#id-1.8.3.17.9">38.14.6. <code class="literal">MERGES</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="xindex.html">38.15. Interfacing Extensions To Indexes</a></span></dt><dd><dl><dt><span class="sect2"><a href="xindex.html#XINDEX-OPCLASS">38.15.1. Index Methods and Operator Classes</a></span></dt><dt><span class="sect2"><a href="xindex.html#XINDEX-STRATEGIES">38.15.2. Index Method Strategies</a></span></dt><dt><span class="sect2"><a href="xindex.html#XINDEX-SUPPORT">38.15.3. Index Method Support Routines</a></span></dt><dt><span class="sect2"><a href="xindex.html#XINDEX-EXAMPLE">38.15.4. An Example</a></span></dt><dt><span class="sect2"><a href="xindex.html#XINDEX-OPFAMILY">38.15.5. Operator Classes and Operator Families</a></span></dt><dt><span class="sect2"><a href="xindex.html#XINDEX-OPCLASS-DEPENDENCIES">38.15.6. System Dependencies on Operator Classes</a></span></dt><dt><span class="sect2"><a href="xindex.html#XINDEX-ORDERING-OPS">38.15.7. Ordering Operators</a></span></dt><dt><span class="sect2"><a href="xindex.html#XINDEX-OPCLASS-FEATURES">38.15.8. Special Features of Operator Classes</a></span></dt></dl></dd><dt><span class="sect1"><a href="extend-extensions.html">38.16. Packaging Related Objects into an Extension</a></span></dt><dd><dl><dt><span class="sect2"><a href="extend-extensions.html#EXTEND-EXTENSIONS-STYLE">38.16.1. Defining Extension Objects</a></span></dt><dt><span class="sect2"><a href="extend-extensions.html#id-1.8.3.19.12">38.16.2. Extension Files</a></span></dt><dt><span class="sect2"><a href="extend-extensions.html#EXTEND-EXTENSIONS-RELOCATION">38.16.3. Extension Relocatability</a></span></dt><dt><span class="sect2"><a href="extend-extensions.html#EXTEND-EXTENSIONS-CONFIG-TABLES">38.16.4. Extension Configuration Tables</a></span></dt><dt><span class="sect2"><a href="extend-extensions.html#id-1.8.3.19.15">38.16.5. Extension Updates</a></span></dt><dt><span class="sect2"><a href="extend-extensions.html#id-1.8.3.19.16">38.16.6. Installing Extensions using Update Scripts</a></span></dt><dt><span class="sect2"><a href="extend-extensions.html#EXTEND-EXTENSIONS-EXAMPLE">38.16.7. Extension Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="extend-pgxs.html">38.17. Extension Building Infrastructure</a></span></dt></dl></div><a id="id-1.8.3.2" class="indexterm"></a><p>
   In  the  sections  that follow, we will discuss how you
   can extend the <span class="productname">PostgreSQL</span>
   <acronym class="acronym">SQL</acronym> query language by adding:

   </p><div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: bullet; "><li class="listitem" style="list-style-type: disc"><p>
      functions (starting in <a class="xref" href="xfunc.html" title="38.3. User-defined Functions">Section 38.3</a>)
     </p></li><li class="listitem" style="list-style-type: disc"><p>
      aggregates (starting in <a class="xref" href="xaggr.html" title="38.11. User-defined Aggregates">Section 38.11</a>)
     </p></li><li class="listitem" style="list-style-type: disc"><p>
      data types (starting in <a class="xref" href="xtypes.html" title="38.12. User-defined Types">Section 38.12</a>)
     </p></li><li class="listitem" style="list-style-type: disc"><p>
      operators (starting in <a class="xref" href="xoper.html" title="38.13. User-defined Operators">Section 38.13</a>)
     </p></li><li class="listitem" style="list-style-type: disc"><p>
      operator classes for indexes (starting in <a class="xref" href="xindex.html" title="38.15. Interfacing Extensions To Indexes">Section 38.15</a>)
     </p></li><li class="listitem" style="list-style-type: disc"><p>
      packages of related objects (starting in <a class="xref" href="extend-extensions.html" title="38.16. Packaging Related Objects into an Extension">Section 38.16</a>)
     </p></li></ul></div><p>
  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="server-programming.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="server-programming.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="extend-how.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part V. Server Programming </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 38.1. How Extensibility Works</td></tr></table></div></body></html>