mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +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:
@ -54,7 +54,12 @@ static char extractModify(DefElem *defel);
|
||||
* "parameters" is a list of DefElem representing the agg's definition clauses.
|
||||
*/
|
||||
ObjectAddress
|
||||
DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List *parameters)
|
||||
DefineAggregate(ParseState *pstate,
|
||||
List *name,
|
||||
List *args,
|
||||
bool oldstyle,
|
||||
List *parameters,
|
||||
bool replace)
|
||||
{
|
||||
char *aggName;
|
||||
Oid aggNamespace;
|
||||
@ -436,6 +441,7 @@ DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List
|
||||
*/
|
||||
return AggregateCreate(aggName, /* aggregate name */
|
||||
aggNamespace, /* namespace */
|
||||
replace,
|
||||
aggKind,
|
||||
numArgs,
|
||||
numDirectArgs,
|
||||
|
Reference in New Issue
Block a user