1ALTER AGGREGATE(7) SQL Commands ALTER AGGREGATE(7)
2
3
4
6 ALTER AGGREGATE - change the definition of an aggregate function
7
8
10 ALTER AGGREGATE name ( type [ , ... ] ) RENAME TO new_name
11 ALTER AGGREGATE name ( type [ , ... ] ) OWNER TO new_owner
12 ALTER AGGREGATE name ( type [ , ... ] ) SET SCHEMA new_schema
13
14
16 ALTER AGGREGATE changes the definition of an aggregate function.
17
18 You must own the aggregate function to use ALTER AGGREGATE. To change
19 the schema of an aggregate function, you must also have CREATE privi‐
20 lege on the new schema. To alter the owner, you must also be a direct
21 or indirect member of the new owning role, and that role must have CRE‐
22 ATE privilege on the aggregate function's schema. (These restrictions
23 enforce that altering the owner doesn't do anything you couldn't do by
24 dropping and recreating the aggregate function. However, a superuser
25 can alter ownership of any aggregate function anyway.)
26
28 name The name (optionally schema-qualified) of an existing aggregate
29 function.
30
31 type An input data type on which the aggregate function operates. To
32 reference a zero-argument aggregate function, write * in place
33 of the list of input data types.
34
35 new_name
36 The new name of the aggregate function.
37
38 new_owner
39 The new owner of the aggregate function.
40
41 new_schema
42 The new schema for the aggregate function.
43
45 To rename the aggregate function myavg for type integer to my_average:
46
47 ALTER AGGREGATE myavg(integer) RENAME TO my_average;
48
49
50 To change the owner of the aggregate function myavg for type integer to
51 joe:
52
53 ALTER AGGREGATE myavg(integer) OWNER TO joe;
54
55
56 To move the aggregate function myavg for type integer into schema
57 myschema:
58
59 ALTER AGGREGATE myavg(integer) SET SCHEMA myschema;
60
61
63 There is no ALTER AGGREGATE statement in the SQL standard.
64
66 CREATE AGGREGATE [create_aggregate(7)], DROP AGGREGATE [drop_aggre‐
67 gate(7)]
68
69
70
71SQL - Language Statements 2014-02-17 ALTER AGGREGATE(7)