]> granicus.if.org Git - postgresql/commitdiff
Fix DROP INDEX CONCURRENTLY IF EXISTS.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 27 Aug 2012 16:45:43 +0000 (12:45 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 27 Aug 2012 16:45:43 +0000 (12:45 -0400)
This threw ERROR, not the expected NOTICE, if the index didn't exist.
The bug was actually visible in not-as-expected regression test output,
so somebody wasn't paying too close attention in commit
8cb53654dbdb4c386369eb988062d0bbb6de725e.
Per report from Brendan Byrd.

src/backend/parser/gram.y
src/test/regress/expected/create_index.out

index 90ea1f9f004f49dc8a52bc2c11db191b6ff8c074..5894cb0885cccf2fd4ba2a7d0d84fdfdd160b0bc 100644 (file)
@@ -4941,7 +4941,7 @@ DropStmt: DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
                                {
                                        DropStmt *n = makeNode(DropStmt);
                                        n->removeType = OBJECT_INDEX;
-                                       n->missing_ok = FALSE;
+                                       n->missing_ok = TRUE;
                                        n->objects = $6;
                                        n->arguments = NIL;
                                        n->behavior = $7;
index 1f27b8e75f6b55a69003bc0ad3adfc5577c2b582..999e38a67986ce4af46bfa7d94d1fd45159b0eda 100644 (file)
@@ -2321,7 +2321,7 @@ Indexes:
 --
 DROP INDEX CONCURRENTLY "concur_index2";                               -- works
 DROP INDEX CONCURRENTLY IF EXISTS "concur_index2";             -- notice
-ERROR:  index "concur_index2" does not exist
+NOTICE:  index "concur_index2" does not exist, skipping
 -- failures
 DROP INDEX CONCURRENTLY "concur_index2", "concur_index3";
 ERROR:  DROP INDEX CONCURRENTLY does not support dropping multiple objects