2 .\" Title: DROP AGGREGATE
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "DROP AGGREGATE" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 DROP_AGGREGATE \- remove an aggregate function
35 DROP AGGREGATE [ IF EXISTS ] \fIname\fR ( \fIaggregate_signature\fR ) [, \&.\&.\&.] [ CASCADE | RESTRICT ]
37 where \fIaggregate_signature\fR is:
40 [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [ , \&.\&.\&. ] |
41 [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [ , \&.\&.\&. ] ] ORDER BY [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [ , \&.\&.\&. ]
46 removes an existing aggregate function\&. To execute this command the current user must be the owner of the aggregate function\&.
51 Do not throw an error if the aggregate does not exist\&. A notice is issued in this case\&.
56 The name (optionally schema\-qualified) of an existing aggregate function\&.
61 The mode of an argument:
64 VARIADIC\&. If omitted, the default is
70 The name of an argument\&. Note that
72 does not actually pay any attention to argument names, since only the argument data types are needed to determine the aggregate function\*(Aqs identity\&.
77 An input data type on which the aggregate function operates\&. To reference a zero\-argument aggregate function, write
79 in place of the list of argument specifications\&. To reference an ordered\-set aggregate function, write
81 between the direct and aggregated argument specifications\&.
86 Automatically drop objects that depend on the aggregate function (such as views using it), and in turn all objects that depend on those objects (see
92 Refuse to drop the aggregate function if any objects depend on it\&. This is the default\&.
96 Alternative syntaxes for referencing ordered\-set aggregates are described under
97 ALTER AGGREGATE (\fBALTER_AGGREGATE\fR(7))\&.
100 To remove the aggregate function
109 DROP AGGREGATE myavg(integer);
115 To remove the hypothetical\-set aggregate function
116 myrank, which takes an arbitrary list of ordering columns and a matching list of direct arguments:
122 DROP AGGREGATE myrank(VARIADIC "any" ORDER BY VARIADIC "any");
128 To remove multiple aggregate functions in one command:
134 DROP AGGREGATE myavg(integer), myavg(bigint);
143 statement in the SQL standard\&.
145 ALTER AGGREGATE (\fBALTER_AGGREGATE\fR(7)), CREATE AGGREGATE (\fBCREATE_AGGREGATE\fR(7))