1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Fix notice message from DROP FUNCTION IF EXISTS, and improve message

for DROP AGGREGATE IF EXISTS.  Per report from Teodor.
This commit is contained in:
Tom Lane
2006-09-25 15:17:34 +00:00
parent 0c858bd69e
commit c232c8afa8
4 changed files with 71 additions and 36 deletions

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.38 2006/07/27 19:52:04 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.39 2006/09/25 15:17:34 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@ -219,8 +219,9 @@ RemoveAggregate(RemoveFuncStmt *stmt)
{
/* we only get here if stmt->missing_ok is true */
ereport(NOTICE,
(errmsg("aggregate %s does not exist ... skipping",
NameListToString(stmt->name))));
(errmsg("aggregate %s(%s) does not exist ... skipping",
NameListToString(aggName),
TypeNameListToString(aggArgs))));
return;
}

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.76 2006/07/14 14:52:18 momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.77 2006/09/25 15:17:34 tgl Exp $
*
* DESCRIPTION
* These routines take the parse tree and pick out the
@ -686,16 +686,16 @@ RemoveFunction(RemoveFuncStmt *stmt)
* Find the function, do permissions and validity checks
*/
funcOid = LookupFuncNameTypeNames(functionName, argTypes, stmt->missing_ok);
if (stmt->missing_ok &&!OidIsValid(funcOid))
if (!OidIsValid(funcOid))
{
/* can only get here if stmt->missing_ok */
ereport(NOTICE,
(errmsg("function %s(%s) does not exist ... skipping",
NameListToString(functionName),
NameListToString(argTypes))));
TypeNameListToString(argTypes))));
return;
}
tup = SearchSysCache(PROCOID,
ObjectIdGetDatum(funcOid),
0, 0, 0);
@ -1409,8 +1409,6 @@ DropCast(DropCastStmt *stmt)
return;
}
/* Permission check */
if (!pg_type_ownercheck(sourcetypeid, GetUserId())
&& !pg_type_ownercheck(targettypeid, GetUserId()))