diff options
author | Andrew Dunstan | 2006-06-16 20:23:45 +0000 |
---|---|---|
committer | Andrew Dunstan | 2006-06-16 20:23:45 +0000 |
commit | bbcd01692bff099117f5afb0fe2d1ad182621766 (patch) | |
tree | 07aebd51aac35be3e0e4471cbff7595a35350d67 /src/backend/commands/aggregatecmds.c | |
parent | e79cc2db00501fb29e3e0225182147192e830fa1 (diff) |
DROP ... IF EXISTS for the following cases:
language, tablespace, trigger, rule, opclass, function, aggregate. operator, and cast.
Diffstat (limited to 'src/backend/commands/aggregatecmds.c')
-rw-r--r-- | src/backend/commands/aggregatecmds.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/backend/commands/aggregatecmds.c b/src/backend/commands/aggregatecmds.c index 7b954edd381..7fb323a8b87 100644 --- a/src/backend/commands/aggregatecmds.c +++ b/src/backend/commands/aggregatecmds.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.34 2006/04/15 17:45:33 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.35 2006/06/16 20:23:44 adunstan Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -211,7 +211,21 @@ RemoveAggregate(RemoveFuncStmt *stmt) ObjectAddress object; /* Look up function and make sure it's an aggregate */ - procOid = LookupAggNameTypeNames(aggName, aggArgs, false); + procOid = LookupAggNameTypeNames(aggName, aggArgs, stmt->missing_ok); + + if (!OidIsValid(procOid)) + { + /* we only get here if stmt->missing_ok is true */ + + /* XXX might need better message here */ + + ereport(NOTICE, + (errmsg("aggregate %s does not exist ... skipping", + stmt->name))); + + + return; + } /* * Find the function tuple, do permissions and validity checks |