The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / drop_aggregate.sgml
blob3b5beac4688a002e8287d6fa3944b0aef79c9634
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPAGGREGATE">
7 <refmeta>
8 <refentrytitle id="SQL-DROPAGGREGATE-TITLE">DROP AGGREGATE</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>DROP AGGREGATE</refname>
15 <refpurpose>remove an aggregate function</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-dropaggregate">
19 <primary>DROP AGGREGATE</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 DROP AGGREGATE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> ( <replaceable class="PARAMETER">type</replaceable> [ , ... ] ) [ CASCADE | RESTRICT ]
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>DROP AGGREGATE</command> removes an existing
33 aggregate function. To execute this command the current
34 user must be the owner of the aggregate function.
35 </para>
36 </refsect1>
38 <refsect1>
39 <title>Parameters</title>
41 <variablelist>
43 <varlistentry>
44 <term><literal>IF EXISTS</literal></term>
45 <listitem>
46 <para>
47 Do not throw an error if the aggregate does not exist. A notice is issued
48 in this case.
49 </para>
50 </listitem>
51 </varlistentry>
53 <varlistentry>
54 <term><replaceable class="parameter">name</replaceable></term>
55 <listitem>
56 <para>
57 The name (optionally schema-qualified) of an existing aggregate function.
58 </para>
59 </listitem>
60 </varlistentry>
62 <varlistentry>
63 <term><replaceable class="parameter">type</replaceable></term>
64 <listitem>
65 <para>
66 An input data type on which the aggregate function operates.
67 To reference a zero-argument aggregate function, write <literal>*</>
68 in place of the list of input data types.
69 </para>
70 </listitem>
71 </varlistentry>
73 <varlistentry>
74 <term><literal>CASCADE</literal></term>
75 <listitem>
76 <para>
77 Automatically drop objects that depend on the aggregate function.
78 </para>
79 </listitem>
80 </varlistentry>
82 <varlistentry>
83 <term><literal>RESTRICT</literal></term>
84 <listitem>
85 <para>
86 Refuse to drop the aggregate function if any objects depend on
87 it. This is the default.
88 </para>
89 </listitem>
90 </varlistentry>
91 </variablelist>
92 </refsect1>
94 <refsect1>
95 <title>Examples</title>
97 <para>
98 To remove the aggregate function <literal>myavg</literal> for type
99 <type>integer</type>:
100 <programlisting>
101 DROP AGGREGATE myavg(integer);
102 </programlisting>
103 </para>
104 </refsect1>
106 <refsect1>
107 <title>Compatibility</title>
109 <para>
110 There is no <command>DROP AGGREGATE</command> statement in the SQL
111 standard.
112 </para>
113 </refsect1>
115 <refsect1>
116 <title>See Also</title>
118 <simplelist type="inline">
119 <member><xref linkend="sql-alteraggregate" endterm="sql-alteraggregate-title"></member>
120 <member><xref linkend="sql-createaggregate" endterm="sql-createaggregate-title"></member>
121 </simplelist>
122 </refsect1>
124 </refentry>