diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-05-11 13:01:07 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-05-11 13:01:07 +0900 |
commit | e16ab408f3db5ced50d84748b7a9f367ece93d3f (patch) | |
tree | fc1a2d31067347eaafbecbb54c06280e807e597c /src/bin/scripts | |
parent | 803f90ab795b6bc170ba517cdd0dfddc85a5f961 (diff) | |
download | postgresql-e16ab408f3db5ced50d84748b7a9f367ece93d3f.tar.gz postgresql-e16ab408f3db5ced50d84748b7a9f367ece93d3f.zip |
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
Diffstat (limited to 'src/bin/scripts')
-rw-r--r-- | src/bin/scripts/reindexdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c index be1c06ebbdb..f62b7ca81ce 100644 --- a/src/bin/scripts/reindexdb.c +++ b/src/bin/scripts/reindexdb.c @@ -307,10 +307,10 @@ reindex_one_database(const char *name, const char *dbname, const char *type, if (strcmp(type, "TABLE") == 0) fprintf(stderr, _("%s: reindexing of table \"%s\" in database \"%s\" failed: %s"), progname, name, PQdb(conn), PQerrorMessage(conn)); - if (strcmp(type, "INDEX") == 0) + else if (strcmp(type, "INDEX") == 0) fprintf(stderr, _("%s: reindexing of index \"%s\" in database \"%s\" failed: %s"), progname, name, PQdb(conn), PQerrorMessage(conn)); - if (strcmp(type, "SCHEMA") == 0) + else if (strcmp(type, "SCHEMA") == 0) fprintf(stderr, _("%s: reindexing of schema \"%s\" in database \"%s\" failed: %s"), progname, name, PQdb(conn), PQerrorMessage(conn)); else |