summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/catalogs.sgml18
-rw-r--r--doc/src/sgml/ref/create_aggregate.sgml50
2 files changed, 68 insertions, 0 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 4a0ede6a72c..bb752294c3f 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -413,6 +413,18 @@
<entry>Combine function (zero if none)</entry>
</row>
<row>
+ <entry><structfield>aggserialfn</structfield></entry>
+ <entry><type>regproc</type></entry>
+ <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
+ <entry>Serialization function (zero if none)</entry>
+ </row>
+ <row>
+ <entry><structfield>aggdeserialfn</structfield></entry>
+ <entry><type>regproc</type></entry>
+ <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
+ <entry>Deserialization function (zero if none)</entry>
+ </row>
+ <row>
<entry><structfield>aggmtransfn</structfield></entry>
<entry><type>regproc</type></entry>
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
@@ -455,6 +467,12 @@
<entry>Data type of the aggregate function's internal transition (state) data</entry>
</row>
<row>
+ <entry><structfield>aggserialtype</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
+ <entry>Return data type of the aggregate function's serialization function (zero if none)</entry>
+ </row>
+ <row>
<entry><structfield>aggtransspace</structfield></entry>
<entry><type>int4</type></entry>
<entry></entry>
diff --git a/doc/src/sgml/ref/create_aggregate.sgml b/doc/src/sgml/ref/create_aggregate.sgml
index 837b83c00b8..7a6f8a97fda 100644
--- a/doc/src/sgml/ref/create_aggregate.sgml
+++ b/doc/src/sgml/ref/create_aggregate.sgml
@@ -28,6 +28,9 @@ CREATE AGGREGATE <replaceable class="parameter">name</replaceable> ( [ <replacea
[ , FINALFUNC = <replaceable class="PARAMETER">ffunc</replaceable> ]
[ , FINALFUNC_EXTRA ]
[ , COMBINEFUNC = <replaceable class="PARAMETER">combinefunc</replaceable> ]
+ [ , SERIALFUNC = <replaceable class="PARAMETER">serialfunc</replaceable> ]
+ [ , DESERIALFUNC = <replaceable class="PARAMETER">deserialfunc</replaceable> ]
+ [ , SERIALTYPE = <replaceable class="PARAMETER">serialtype</replaceable> ]
[ , INITCOND = <replaceable class="PARAMETER">initial_condition</replaceable> ]
[ , MSFUNC = <replaceable class="PARAMETER">msfunc</replaceable> ]
[ , MINVFUNC = <replaceable class="PARAMETER">minvfunc</replaceable> ]
@@ -47,6 +50,9 @@ CREATE AGGREGATE <replaceable class="parameter">name</replaceable> ( [ [ <replac
[ , FINALFUNC = <replaceable class="PARAMETER">ffunc</replaceable> ]
[ , FINALFUNC_EXTRA ]
[ , COMBINEFUNC = <replaceable class="PARAMETER">combinefunc</replaceable> ]
+ [ , SERIALFUNC = <replaceable class="PARAMETER">serialfunc</replaceable> ]
+ [ , DESERIALFUNC = <replaceable class="PARAMETER">deserialfunc</replaceable> ]
+ [ , SERIALTYPE = <replaceable class="PARAMETER">serialtype</replaceable> ]
[ , INITCOND = <replaceable class="PARAMETER">initial_condition</replaceable> ]
[ , HYPOTHETICAL ]
)
@@ -61,6 +67,9 @@ CREATE AGGREGATE <replaceable class="PARAMETER">name</replaceable> (
[ , FINALFUNC = <replaceable class="PARAMETER">ffunc</replaceable> ]
[ , FINALFUNC_EXTRA ]
[ , COMBINEFUNC = <replaceable class="PARAMETER">combinefunc</replaceable> ]
+ [ , SERIALFUNC = <replaceable class="PARAMETER">serialfunc</replaceable> ]
+ [ , DESERIALFUNC = <replaceable class="PARAMETER">deserialfunc</replaceable> ]
+ [ , SERIALTYPE = <replaceable class="PARAMETER">serialtype</replaceable> ]
[ , INITCOND = <replaceable class="PARAMETER">initial_condition</replaceable> ]
[ , MSFUNC = <replaceable class="PARAMETER">msfunc</replaceable> ]
[ , MINVFUNC = <replaceable class="PARAMETER">minvfunc</replaceable> ]
@@ -437,6 +446,47 @@ SELECT col FROM tab ORDER BY col USING sortop LIMIT 1;
</varlistentry>
<varlistentry>
+ <term><replaceable class="PARAMETER">serialfunc</replaceable></term>
+ <listitem>
+ <para>
+ In order to allow aggregate functions with an <literal>INTERNAL</>
+ <replaceable class="PARAMETER">state_data_type</replaceable> to
+ participate in parallel aggregation, the aggregate must have a valid
+ <replaceable class="PARAMETER">serialfunc</replaceable>, which must
+ serialize the aggregate state into <replaceable class="PARAMETER">
+ serialtype</replaceable>. This function must take a single argument of
+ <replaceable class="PARAMETER">state_data_type</replaceable> and return
+ <replaceable class="PARAMETER">serialtype</replaceable>. A
+ corresponding <replaceable class="PARAMETER">deserialfunc</replaceable>
+ is also required.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="PARAMETER">deserialfunc</replaceable></term>
+ <listitem>
+ <para>
+ Deserializes a previously serialized aggregate state back into
+ <replaceable class="PARAMETER">state_data_type</replaceable>. This
+ function must take a single argument of <replaceable class="PARAMETER">
+ serialtype</replaceable> and return <replaceable class="PARAMETER">
+ state_data_type</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="PARAMETER">serialtype</replaceable></term>
+ <listitem>
+ <para>
+ The data type to into which an <literal>INTERNAL</literal> aggregate
+ state should be serialized.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><replaceable class="PARAMETER">initial_condition</replaceable></term>
<listitem>
<para>