Sophie

Sophie

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

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>52.2. pg_aggregate</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="catalogs-overview.html" title="52.1. Overview" /><link rel="next" href="catalog-pg-am.html" title="52.3. pg_am" /></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">52.2. <code xmlns="http://www.w3.org/1999/xhtml" class="structname">pg_aggregate</code></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="catalogs-overview.html" title="52.1. Overview">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="Chapter 52. System Catalogs">Up</a></td><th width="60%" align="center">Chapter 52. System Catalogs</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="catalog-pg-am.html" title="52.3. pg_am">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="CATALOG-PG-AGGREGATE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.2. <code class="structname">pg_aggregate</code></h2></div></div></div><a id="id-1.10.4.4.2" class="indexterm"></a><p>
   The catalog <code class="structname">pg_aggregate</code> stores information about
   aggregate functions.  An aggregate function is a function that
   operates on a set of values (typically one column from each row
   that matches a query condition) and returns a single value computed
   from all these values.  Typical aggregate functions are
   <code class="function">sum</code>, <code class="function">count</code>, and
   <code class="function">max</code>.  Each entry in
   <code class="structname">pg_aggregate</code> is an extension of an entry
   in <code class="structname">pg_proc</code>.  The <code class="structname">pg_proc</code>
   entry carries the aggregate's name, input and output data types, and
   other information that is similar to ordinary functions.
  </p><div class="table" id="id-1.10.4.4.4"><p class="title"><strong>Table 52.2. <code class="structname">pg_aggregate</code> Columns</strong></p><div class="table-contents"><table class="table" summary="pg_aggregate Columns" border="1"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th>Name</th><th>Type</th><th>References</th><th>Description</th></tr></thead><tbody><tr><td><code class="structfield">aggfnoid</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td><code class="structname">pg_proc</code> OID of the aggregate function</td></tr><tr><td><code class="structfield">aggkind</code></td><td><code class="type">char</code></td><td> </td><td>Aggregate kind:
       <code class="literal">n</code> for <span class="quote">“<span class="quote">normal</span>”</span> aggregates,
       <code class="literal">o</code> for <span class="quote">“<span class="quote">ordered-set</span>”</span> aggregates, or
       <code class="literal">h</code> for <span class="quote">“<span class="quote">hypothetical-set</span>”</span> aggregates
      </td></tr><tr><td><code class="structfield">aggnumdirectargs</code></td><td><code class="type">int2</code></td><td> </td><td>Number of direct (non-aggregated) arguments of an ordered-set or
       hypothetical-set aggregate, counting a variadic array as one argument.
       If equal to <code class="structfield">pronargs</code>, the aggregate must be variadic
       and the variadic array describes the aggregated arguments as well as
       the final direct arguments.
       Always zero for normal aggregates.</td></tr><tr><td><code class="structfield">aggtransfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>Transition function</td></tr><tr><td><code class="structfield">aggfinalfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>Final function (zero if none)</td></tr><tr><td><code class="structfield">aggcombinefn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>Combine function (zero if none)</td></tr><tr><td><code class="structfield">aggserialfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>Serialization function (zero if none)</td></tr><tr><td><code class="structfield">aggdeserialfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>Deserialization function (zero if none)</td></tr><tr><td><code class="structfield">aggmtransfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>Forward transition function for moving-aggregate mode (zero if none)</td></tr><tr><td><code class="structfield">aggminvtransfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>Inverse transition function for moving-aggregate mode (zero if none)</td></tr><tr><td><code class="structfield">aggmfinalfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>Final function for moving-aggregate mode (zero if none)</td></tr><tr><td><code class="structfield">aggfinalextra</code></td><td><code class="type">bool</code></td><td> </td><td>True to pass extra dummy arguments to <code class="structfield">aggfinalfn</code></td></tr><tr><td><code class="structfield">aggmfinalextra</code></td><td><code class="type">bool</code></td><td> </td><td>True to pass extra dummy arguments to <code class="structfield">aggmfinalfn</code></td></tr><tr><td><code class="structfield">aggfinalmodify</code></td><td><code class="type">char</code></td><td> </td><td>Whether <code class="structfield">aggfinalfn</code> modifies the
       transition state value:
       <code class="literal">r</code> if it is read-only,
       <code class="literal">s</code> if the <code class="structfield">aggtransfn</code>
       cannot be applied after the <code class="structfield">aggfinalfn</code>, or
       <code class="literal">w</code> if it writes on the value
      </td></tr><tr><td><code class="structfield">aggmfinalmodify</code></td><td><code class="type">char</code></td><td> </td><td>Like <code class="structfield">aggfinalmodify</code>, but for
       the <code class="structfield">aggmfinalfn</code>
      </td></tr><tr><td><code class="structfield">aggsortop</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-operator.html" title="52.34. pg_operator"><code class="structname">pg_operator</code></a>.oid</code></td><td>Associated sort operator (zero if none)</td></tr><tr><td><code class="structfield">aggtranstype</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-type.html" title="52.62. pg_type"><code class="structname">pg_type</code></a>.oid</code></td><td>Data type of the aggregate function's internal transition (state) data</td></tr><tr><td><code class="structfield">aggtransspace</code></td><td><code class="type">int4</code></td><td> </td><td>Approximate average size (in bytes) of the transition state
       data, or zero to use a default estimate</td></tr><tr><td><code class="structfield">aggmtranstype</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-type.html" title="52.62. pg_type"><code class="structname">pg_type</code></a>.oid</code></td><td>Data type of the aggregate function's internal transition (state)
       data for moving-aggregate mode (zero if none)</td></tr><tr><td><code class="structfield">aggmtransspace</code></td><td><code class="type">int4</code></td><td> </td><td>Approximate average size (in bytes) of the transition state data
       for moving-aggregate mode, or zero to use a default estimate</td></tr><tr><td><code class="structfield">agginitval</code></td><td><code class="type">text</code></td><td> </td><td>
       The initial value of the transition state.  This is a text
       field containing the initial value in its external string
       representation.  If this field is null, the transition state
       value starts out null.
      </td></tr><tr><td><code class="structfield">aggminitval</code></td><td><code class="type">text</code></td><td> </td><td>
       The initial value of the transition state for moving-aggregate mode.
       This is a text field containing the initial value in its external
       string representation.  If this field is null, the transition state
       value starts out null.
      </td></tr></tbody></table></div></div><br class="table-break" /><p>
   New aggregate functions are registered with the <a class="xref" href="sql-createaggregate.html" title="CREATE AGGREGATE"><span class="refentrytitle">CREATE AGGREGATE</span></a>
   command.  See <a class="xref" href="xaggr.html" title="38.11. User-defined Aggregates">Section 38.11</a> for more information about
   writing aggregate functions and the meaning of the transition
   functions, etc.
  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="catalogs-overview.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="catalogs.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="catalog-pg-am.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">52.1. Overview </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 52.3. <code class="structname">pg_am</code></td></tr></table></div></body></html>