diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2006-06-16 20:23:45 +0000 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2006-06-16 20:23:45 +0000 |
commit | bbcd01692bff099117f5afb0fe2d1ad182621766 (patch) | |
tree | 07aebd51aac35be3e0e4471cbff7595a35350d67 /src/backend/commands/operatorcmds.c | |
parent | e79cc2db00501fb29e3e0225182147192e830fa1 (diff) | |
download | postgresql-bbcd01692bff099117f5afb0fe2d1ad182621766.tar.gz postgresql-bbcd01692bff099117f5afb0fe2d1ad182621766.zip |
DROP ... IF EXISTS for the following cases:
language, tablespace, trigger, rule, opclass, function, aggregate. operator, and cast.
Diffstat (limited to 'src/backend/commands/operatorcmds.c')
-rw-r--r-- | src/backend/commands/operatorcmds.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c index 54f50a84771..04c91f4509e 100644 --- a/src/backend/commands/operatorcmds.c +++ b/src/backend/commands/operatorcmds.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.30 2006/04/15 17:45:34 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.31 2006/06/16 20:23:44 adunstan Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -213,7 +213,15 @@ RemoveOperator(RemoveFuncStmt *stmt) Assert(list_length(stmt->args) == 2); operOid = LookupOperNameTypeNames(NULL, operatorName, typeName1, typeName2, - false, -1); + stmt->missing_ok, -1); + + if (stmt->missing_ok &&!OidIsValid(operOid) ) + { + ereport(NOTICE, + (errmsg("operator %s does not exist ... skipping", + NameListToString(operatorName)))); + return; + } tup = SearchSysCache(OPEROID, ObjectIdGetDatum(operOid), |