postgres.git / summary / log / commit / refs
commit e17fba8d8f13a52b544478481c9505e2efe99dc2
Author: Michael Paquier <michael@paquier.xyz>
Date: Sat May 11 04:01:24 2019 +0000
First released in: 12.0, 9.4.23, 9.5.18, 9.6.14, 10.9, 11.4
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
src/bin/scripts/reindexdb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c
index 4151f1f4402..f71b9b3e95a 100644
--- a/src/bin/scripts/reindexdb.c
+++ b/src/bin/scripts/reindexdb.c
@@ -306,10 +306,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
[parent: 91a05390c33c]