]> granicus.if.org Git - postgresql/commitdiff
Fix DROP OPERATOR FAMILY IF EXISTS.
authorRobert Haas <rhaas@postgresql.org>
Fri, 21 Oct 2011 13:10:46 +0000 (09:10 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 21 Oct 2011 13:13:39 +0000 (09:13 -0400)
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.

src/backend/commands/opclasscmds.c

index 2bb0d4c3b5fc74076323b154155965e99443b6c8..8bad626c834b952b61d35c6b232d77efe1f6e50a 100644 (file)
@@ -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;
        }