Fix DROP INDEX CONCURRENTLY IF EXISTS.

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
8cb53654db.
Per report from Brendan Byrd.
This commit is contained in:
Tom Lane 2012-08-27 12:45:43 -04:00
parent e40bddb0f3
commit e323c55301
2 changed files with 2 additions and 2 deletions

View File

@ -4941,7 +4941,7 @@ DropStmt: DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
{ {
DropStmt *n = makeNode(DropStmt); DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_INDEX; n->removeType = OBJECT_INDEX;
n->missing_ok = FALSE; n->missing_ok = TRUE;
n->objects = $6; n->objects = $6;
n->arguments = NIL; n->arguments = NIL;
n->behavior = $7; n->behavior = $7;

View File

@ -2321,7 +2321,7 @@ Indexes:
-- --
DROP INDEX CONCURRENTLY "concur_index2"; -- works DROP INDEX CONCURRENTLY "concur_index2"; -- works
DROP INDEX CONCURRENTLY IF EXISTS "concur_index2"; -- notice DROP INDEX CONCURRENTLY IF EXISTS "concur_index2"; -- notice
ERROR: index "concur_index2" does not exist NOTICE: index "concur_index2" does not exist, skipping
-- failures -- failures
DROP INDEX CONCURRENTLY "concur_index2", "concur_index3"; DROP INDEX CONCURRENTLY "concur_index2", "concur_index3";
ERROR: DROP INDEX CONCURRENTLY does not support dropping multiple objects ERROR: DROP INDEX CONCURRENTLY does not support dropping multiple objects