summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2011-10-21 09:10:46 -0400
committerRobert Haas <rhaas@postgresql.org>2011-10-21 09:13:39 -0400
commit5c5138f2f8c7770e05036f991e7d29b8060d5218 (patch)
treec78e872b9df413b75a6162809ef61411bd96cb0d
parentd1d094e4cf7d80cb2b4f68b5e8ce11aa9ebcbf3c (diff)
Fix DROP OPERATOR FAMILY IF EXISTS.
Essentially, the "IF EXISTS" portion was being ignored, and an error thrown anyway if the opfamily did not exist. I broke this in commit fd1843ff8979c0461fb3f1a9eab61140c977e32d; so backpatch to 9.1.X. Report and diagnosis by KaiGai Kohei.
-rw-r--r--src/backend/commands/opclasscmds.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c
index 2bb0d4c3b5f..8bad626c834 100644
--- a/src/backend/commands/opclasscmds.c
+++ b/src/backend/commands/opclasscmds.c
@@ -1614,10 +1614,9 @@ RemoveOpFamily(RemoveOpFamilyStmt *stmt)
tuple = OpFamilyCacheLookup(amID, stmt->opfamilyname, stmt->missing_ok);
if (!HeapTupleIsValid(tuple))
{
- ereport(ERROR,
- (errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("operator family \"%s\" does not exist for access method \"%s\"",
- NameListToString(stmt->opfamilyname), stmt->amname)));
+ ereport(NOTICE,
+ (errmsg("operator family \"%s\" does not exist for access method \"%s\", skipping",
+ NameListToString(stmt->opfamilyname), stmt->amname)));
return;
}