8000 Fix DROP OPERATOR FAMILY IF EXISTS. · jaylevitt/postgres@5c5138f · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c5138f

Browse files
committed
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 fd1843f; so backpatch to 9.1.X. Report and diagnosis by KaiGai Kohei.
1 parent d1d094e commit 5c5138f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/backend/commands/opclasscmds.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,10 +1614,9 @@ RemoveOpFamily(RemoveOpFamilyStmt *stmt)
16141614
tuple = OpFamilyCacheLookup(amID, stmt->opfamilyname, stmt->missing_ok);
16151615
if (!HeapTupleIsValid(tuple))
16161616
{
1617-
ereport(ERROR,
1618-
(errcode(ERRCODE_UNDEFINED_OBJECT),
1619-
errmsg("operator family \"%s\" does not exist for access method \"%s\"",
1620-
NameListToString(stmt->opfamilyname), stmt->amname)));
1617+
ereport(NOTICE,
1618+
(errmsg("operator family \"%s\" does not exist for access method \"%s\", skipping",
1619+
NameListToString(stmt->opfamilyname), stmt->amname)));
16211620
return;
16221621
}
16231622

0 commit comments

Comments
 (0)
0