2 doc/src/sgml/ref/drop_aggregate.sgml
3 PostgreSQL documentation
6 <refentry id="SQL-DROPAGGREGATE">
7 <indexterm zone="sql-dropaggregate">
8 <primary>DROP AGGREGATE</primary>
12 <refentrytitle>DROP AGGREGATE</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements</refmiscinfo>
18 <refname>DROP AGGREGATE</refname>
19 <refpurpose>remove an aggregate function</refpurpose>
24 DROP AGGREGATE [ IF EXISTS ] <replaceable>name</replaceable> ( <replaceable>aggregate_signature</replaceable> ) [, ...] [ CASCADE | RESTRICT ]
26 <phrase>where <replaceable>aggregate_signature</replaceable> is:</phrase>
29 [ <replaceable>argmode</replaceable> ] [ <replaceable>argname</replaceable> ] <replaceable>argtype</replaceable> [ , ... ] |
30 [ [ <replaceable>argmode</replaceable> ] [ <replaceable>argname</replaceable> ] <replaceable>argtype</replaceable> [ , ... ] ] ORDER BY [ <replaceable>argmode</replaceable> ] [ <replaceable>argname</replaceable> ] <replaceable>argtype</replaceable> [ , ... ]
35 <title>Description</title>
38 <command>DROP AGGREGATE</command> removes an existing
39 aggregate function. To execute this command the current
40 user must be the owner of the aggregate function.
45 <title>Parameters</title>
50 <term><literal>IF EXISTS</literal></term>
53 Do not throw an error if the aggregate does not exist. A notice is issued
60 <term><replaceable class="parameter">name</replaceable></term>
63 The name (optionally schema-qualified) of an existing aggregate function.
69 <term><replaceable class="parameter">argmode</replaceable></term>
73 The mode of an argument: <literal>IN</> or <literal>VARIADIC</>.
74 If omitted, the default is <literal>IN</>.
80 <term><replaceable class="parameter">argname</replaceable></term>
84 The name of an argument.
85 Note that <command>DROP AGGREGATE</command> does not actually pay
86 any attention to argument names, since only the argument data
87 types are needed to determine the aggregate function's identity.
93 <term><replaceable class="parameter">argtype</replaceable></term>
96 An input data type on which the aggregate function operates.
97 To reference a zero-argument aggregate function, write <literal>*</>
98 in place of the list of argument specifications.
99 To reference an ordered-set aggregate function, write
100 <literal>ORDER BY</> between the direct and aggregated argument
107 <term><literal>CASCADE</literal></term>
110 Automatically drop objects that depend on the aggregate function
111 (such as views using it),
112 and in turn all objects that depend on those objects
113 (see <xref linkend="ddl-depend">).
119 <term><literal>RESTRICT</literal></term>
122 Refuse to drop the aggregate function if any objects depend on
123 it. This is the default.
134 Alternative syntaxes for referencing ordered-set aggregates
135 are described under <xref linkend="sql-alteraggregate">.
140 <title>Examples</title>
143 To remove the aggregate function <literal>myavg</literal> for type
144 <type>integer</type>:
146 DROP AGGREGATE myavg(integer);
151 To remove the hypothetical-set aggregate function <literal>myrank</>,
152 which takes an arbitrary list of ordering columns and a matching list
155 DROP AGGREGATE myrank(VARIADIC "any" ORDER BY VARIADIC "any");
160 To remove multiple aggregate functions in one command:
162 DROP AGGREGATE myavg(integer), myavg(bigint);
168 <title>Compatibility</title>
171 There is no <command>DROP AGGREGATE</command> statement in the SQL
177 <title>See Also</title>
179 <simplelist type="inline">
180 <member><xref linkend="sql-alteraggregate"></member>
181 <member><xref linkend="sql-createaggregate"></member>