Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9802619

Browse files
committed
Fix DROP OPERATOR FAMILY IF EXISTS.
Essentially, the "IF EXISTS" portion was being ignored, and an errorthrown anyway if the opfamily did not exist.I broke this in commitfd1843f; sobackpatch to 9.1.X.Report and diagnosis by KaiGai Kohei.
1 parentb4a0223 commit9802619

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

‎src/backend/commands/opclasscmds.c

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

‎src/test/regress/expected/drop_if_exists.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ ERROR: access method "no_such_am" does not exist
214214
DROP OPERATOR FAMILY test_operator_family USING btree;
215215
ERROR: operator family "test_operator_family" does not exist for access method "btree"
216216
DROP OPERATOR FAMILY IF EXISTS test_operator_family USING btree;
217-
ERROR: operator family "test_operator_family" does not exist for access method "btree"
217+
NOTICE: operator family "test_operator_family" does not exist for access method "btree", skipping
218218
DROP OPERATOR FAMILY test_operator_family USING no_such_am;
219219
ERROR: access method "no_such_am" does not exist
220220
DROP OPERATOR FAMILY IF EXISTS test_operator_family USING no_such_am;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp