diff options
Diffstat (limited to 'src/backend/commands/comment.c')
| -rw-r--r-- | src/backend/commands/comment.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c index 07d8278525..ec4762750f 100644 --- a/src/backend/commands/comment.c +++ b/src/backend/commands/comment.c @@ -7,7 +7,7 @@ * Copyright (c) 1996-2006, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.88 2006/03/14 22:48:18 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.89 2006/04/15 17:45:34 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -868,28 +868,17 @@ CommentType(List *typename, char *comment) * * This routine is used to allow a user to provide comments on an * aggregate function. The aggregate function is determined by both - * its name and its argument type, which, with the comments are - * the three parameters handed to this routine. + * its name and its argument type(s). */ static void CommentAggregate(List *aggregate, List *arguments, char *comment) { - TypeName *aggtype = (TypeName *) linitial(arguments); - Oid baseoid, - oid; - - /* First, attempt to determine the base aggregate oid */ - if (aggtype) - baseoid = typenameTypeId(NULL, aggtype); - else - baseoid = ANYOID; - - /* Now, attempt to find the actual tuple in pg_proc */ + Oid oid; - oid = find_aggregate_func(aggregate, baseoid, false); + /* Look up function and make sure it's an aggregate */ + oid = LookupAggNameTypeNames(aggregate, arguments, false); /* Next, validate the user's attempt to comment */ - if (!pg_proc_ownercheck(oid, GetUserId())) aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_PROC, NameListToString(aggregate)); |
