ALTER AGGREGATE changes the definition of an aggregate function.
You must own the aggregate function to use ALTER AGGREGATE. To change the schema of an aggregate
function, you must also have CREATE privilege on the new schema. To alter the owner, you must
also be a direct or indirect member of the new owning role, and that role must have CREATE privilege
on the aggregate function’s schema. (These restrictions enforce that altering the owner doesn’t do
anything you couldn’t do by dropping and recreating the aggregate function. However, a superuser
can alter ownership of any aggregate function anyway.)
Example
ALTER AGGREGATE name ( aggregate_signature ) RENAME TO
new_name
ALTER AGGREGATE name ( aggregate_signature )
OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
ALTER AGGREGATE name ( aggregate_signature ) SET SCHEMA
new_schema