From: Robert Haas Date: Fri, 21 Oct 2011 13:10:46 +0000 (-0400) Subject: Fix DROP OPERATOR FAMILY IF EXISTS. X-Git-Tag: REL9_1_2~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c5138f2f8c7770e05036f991e7d29b8060d5218;p=postgresql 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. --- diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index 2bb0d4c3b5..8bad626c83 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; }