summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier2019-05-11 04:00:54 +0000
committerMichael Paquier2019-05-11 04:00:54 +0000
commite51bad8fb4c3f0ad5cb173034afdc0b349c7e488 (patch)
tree8574ebef4e7e55aa73b29afb9d81a20376a915f6
parentb721e201a0bcf0f9e1795c295e134e47d698e80c (diff)
Fix error reporting in reindexdb
When failing to reindex a table or an index, reindexdb would generate an extra error message related to a database failure, which is misleading. Backpatch all the way down, as this has been introduced by 85e9a5a0. Discussion: https://postgr.es/m/CAOBaU_Yo61RwNO3cW6WVYWwH7EYMPuexhKqufb2nFGOdunbcHw@mail.gmail.com Author: Julien Rouhaud Reviewed-by: Daniel Gustafsson, Álvaro Herrera, Tom Lane, Michael Paquier Backpatch-through: 9.4
-rw-r--r--src/bin/scripts/reindexdb.c4
1 files changed, 2 insertions, 2 deletions
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