fix_error_reporting_reindexdb-v1.diff

text/x-patch

Filename: fix_error_reporting_reindexdb-v1.diff
Type: text/x-patch
Part: 0
Message: Bug in reindexdb's error reporting

Patch

Format: unified
Series: patch v1
File+
src/bin/scripts/reindexdb.c 2 2
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c
index d6f3efd313..897ad9a71a 100644
--- a/src/bin/scripts/reindexdb.c
+++ b/src/bin/scripts/reindexdb.c
@@ -325,10 +325,10 @@ reindex_one_database(const char *name, const char *dbname, const char *type,
 		if (strcmp(type, "TABLE") == 0)
 			pg_log_error("reindexing of table \"%s\" in database \"%s\" failed: %s",
 						 name, PQdb(conn), PQerrorMessage(conn));
-		if (strcmp(type, "INDEX") == 0)
+		else if (strcmp(type, "INDEX") == 0)
 			pg_log_error("reindexing of index \"%s\" in database \"%s\" failed: %s",
 						 name, PQdb(conn), PQerrorMessage(conn));
-		if (strcmp(type, "SCHEMA") == 0)
+		else if (strcmp(type, "SCHEMA") == 0)
 			pg_log_error("reindexing of schema \"%s\" in database \"%s\" failed: %s",
 						 name, PQdb(conn), PQerrorMessage(conn));
 		else