1ALTER AGGREGATE(7) PostgreSQL 9.2.24 Documentation ALTER AGGREGATE(7)
2
3
4
6 ALTER_AGGREGATE - change the definition of an aggregate function
7
9 ALTER AGGREGATE name ( argtype [ , ... ] ) RENAME TO new_name
10 ALTER AGGREGATE name ( argtype [ , ... ] ) OWNER TO new_owner
11 ALTER AGGREGATE name ( argtype [ , ... ] ) SET SCHEMA new_schema
12
14 ALTER AGGREGATE changes the definition of an aggregate function.
15
16 You must own the aggregate function to use ALTER AGGREGATE. To change
17 the schema of an aggregate function, you must also have CREATE
18 privilege on the new schema. To alter the owner, you must also be a
19 direct or indirect member of the new owning role, and that role must
20 have CREATE privilege on the aggregate function's schema. (These
21 restrictions enforce that altering the owner doesn't do anything you
22 couldn't do by dropping and recreating the aggregate function. However,
23 a superuser can alter ownership of any aggregate function anyway.)
24
26 name
27 The name (optionally schema-qualified) of an existing aggregate
28 function.
29
30 argtype
31 An input data type on which the aggregate function operates. To
32 reference a zero-argument aggregate function, write * in place of
33 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 To change the owner of the aggregate function myavg for type integer to
50 joe:
51
52 ALTER AGGREGATE myavg(integer) OWNER TO joe;
53
54 To move the aggregate function myavg for type integer into schema
55 myschema:
56
57 ALTER AGGREGATE myavg(integer) SET SCHEMA myschema;
58
60 There is no ALTER AGGREGATE statement in the SQL standard.
61
63 CREATE AGGREGATE (CREATE_AGGREGATE(7)), DROP AGGREGATE
64 (DROP_AGGREGATE(7))
65
66
67
68PostgreSQL 9.2.24 2017-11-06 ALTER AGGREGATE(7)