]> begriffs open source - ai-pg/blob - full-docs/txt/sql-dropaggregate.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-dropaggregate.txt
1
2 DROP AGGREGATE
3
4    DROP AGGREGATE — remove an aggregate function
5
6 Synopsis
7
8 DROP AGGREGATE [ IF EXISTS ] name ( aggregate_signature ) [, ...] [ CASCADE | RE
9 STRICT ]
10
11 where aggregate_signature is:
12
13 * |
14 [ argmode ] [ argname ] argtype [ , ... ] |
15 [ [ argmode ] [ argname ] argtype [ , ... ] ] ORDER BY [ argmode ] [ argname ] a
16 rgtype [ , ... ]
17
18 Description
19
20    DROP AGGREGATE removes an existing aggregate function. To execute this
21    command the current user must be the owner of the aggregate function.
22
23 Parameters
24
25    IF EXISTS
26           Do not throw an error if the aggregate does not exist. A notice
27           is issued in this case.
28
29    name
30           The name (optionally schema-qualified) of an existing aggregate
31           function.
32
33    argmode
34           The mode of an argument: IN or VARIADIC. If omitted, the default
35           is IN.
36
37    argname
38           The name of an argument. Note that DROP AGGREGATE does not
39           actually pay any attention to argument names, since only the
40           argument data types are needed to determine the aggregate
41           function's identity.
42
43    argtype
44           An input data type on which the aggregate function operates. To
45           reference a zero-argument aggregate function, write * in place
46           of the list of argument specifications. To reference an
47           ordered-set aggregate function, write ORDER BY between the
48           direct and aggregated argument specifications.
49
50    CASCADE
51           Automatically drop objects that depend on the aggregate function
52           (such as views using it), and in turn all objects that depend on
53           those objects (see Section 5.15).
54
55    RESTRICT
56           Refuse to drop the aggregate function if any objects depend on
57           it. This is the default.
58
59 Notes
60
61    Alternative syntaxes for referencing ordered-set aggregates are
62    described under ALTER AGGREGATE.
63
64 Examples
65
66    To remove the aggregate function myavg for type integer:
67 DROP AGGREGATE myavg(integer);
68
69    To remove the hypothetical-set aggregate function myrank, which takes
70    an arbitrary list of ordering columns and a matching list of direct
71    arguments:
72 DROP AGGREGATE myrank(VARIADIC "any" ORDER BY VARIADIC "any");
73
74    To remove multiple aggregate functions in one command:
75 DROP AGGREGATE myavg(integer), myavg(bigint);
76
77 Compatibility
78
79    There is no DROP AGGREGATE statement in the SQL standard.
80
81 See Also
82
83    ALTER AGGREGATE, CREATE AGGREGATE