From 3651a3e6fb41121f2262577774382e84bf9a3177 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 15 Apr 2006 17:45:46 +0000 Subject: Support the syntax CREATE AGGREGATE aggname (input_type) (parameter_list) along with the old syntax where the input type was named in the parameter list. This fits more naturally with the way that the aggregate is identified in DROP AGGREGATE and other utility commands; furthermore it has a natural extension to handle multiple-input aggregates, where the basetype-parameter method would get ugly. In fact, this commit fixes the grammar and all the utility commands to support multiple-input aggregates; but DefineAggregate rejects it because the executor isn't fixed yet. I didn't do anything about treating agg(*) as a zero-input aggregate instead of artificially making it a one-input aggregate, but that should be considered in combination with supporting multi-input aggregates. --- src/include/commands/defrem.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/include/commands') diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index 99e061d2def..f6ed06f3dbf 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.71 2006/03/05 15:58:55 momjian Exp $ + * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.72 2006/04/15 17:45:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -57,22 +57,23 @@ extern void AlterFunction(AlterFunctionStmt *stmt); extern void CreateCast(CreateCastStmt *stmt); extern void DropCast(DropCastStmt *stmt); extern void DropCastById(Oid castOid); -extern void AlterFunctionNamespace(List *name, List *argtypes, +extern void AlterFunctionNamespace(List *name, List *argtypes, bool isagg, const char *newschema); /* commands/operatorcmds.c */ extern void DefineOperator(List *names, List *parameters); -extern void RemoveOperator(RemoveOperStmt *stmt); +extern void RemoveOperator(RemoveFuncStmt *stmt); extern void RemoveOperatorById(Oid operOid); extern void AlterOperatorOwner(List *name, TypeName *typeName1, TypeName *typename2, Oid newOwnerId); extern void AlterOperatorOwner_oid(Oid operOid, Oid newOwnerId); /* commands/aggregatecmds.c */ -extern void DefineAggregate(List *names, List *parameters); -extern void RemoveAggregate(RemoveAggrStmt *stmt); -extern void RenameAggregate(List *name, TypeName *basetype, const char *newname); -extern void AlterAggregateOwner(List *name, TypeName *basetype, Oid newOwnerId); +extern void DefineAggregate(List *name, List *args, bool oldstyle, + List *parameters); +extern void RemoveAggregate(RemoveFuncStmt *stmt); +extern void RenameAggregate(List *name, List *args, const char *newname); +extern void AlterAggregateOwner(List *name, List *args, Oid newOwnerId); /* commands/opclasscmds.c */ extern void DefineOpClass(CreateOpClassStmt *stmt); -- cgit v1.2.3