mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Implement OR REPLACE option for CREATE AGGREGATE.
Aggregates have acquired a dozen or so optional attributes in recent years for things like parallel query and moving-aggregate mode; the lack of an OR REPLACE option to add or change these for an existing agg makes extension upgrades gratuitously hard. Rectify.
This commit is contained in:
@@ -404,7 +404,9 @@ ProcedureCreate(const char *procedureName,
|
||||
errdetail("\"%s\" is a window function.", procedureName) :
|
||||
0)));
|
||||
|
||||
dropcmd = (prokind == PROKIND_PROCEDURE ? "DROP PROCEDURE" : "DROP FUNCTION");
|
||||
dropcmd = (prokind == PROKIND_PROCEDURE ? "DROP PROCEDURE" :
|
||||
prokind == PROKIND_AGGREGATE ? "DROP AGGREGATE" :
|
||||
"DROP FUNCTION");
|
||||
|
||||
/*
|
||||
* Not okay to change the return type of the existing proc, since
|
||||
@@ -421,7 +423,7 @@ ProcedureCreate(const char *procedureName,
|
||||
prokind == PROKIND_PROCEDURE
|
||||
? errmsg("cannot change whether a procedure has output parameters")
|
||||
: errmsg("cannot change return type of existing function"),
|
||||
/* translator: first %s is DROP FUNCTION or DROP PROCEDURE */
|
||||
/* translator: first %s is DROP FUNCTION, DROP PROCEDURE or DROP AGGREGATE */
|
||||
errhint("Use %s %s first.",
|
||||
dropcmd,
|
||||
format_procedure(oldproc->oid))));
|
||||
|
||||
Reference in New Issue
Block a user