Skip to content

Commit e16ab40

Browse files
committed
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 85e9a5a. 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
1 parent 803f90a commit e16ab40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/scripts/reindexdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@ reindex_one_database(const char *name, const char *dbname, const char *type,
307307
if (strcmp(type, "TABLE") == 0)
308308
fprintf(stderr, _("%s: reindexing of table \"%s\" in database \"%s\" failed: %s"),
309309
progname, name, PQdb(conn), PQerrorMessage(conn));
310-
if (strcmp(type, "INDEX") == 0)
310+
else if (strcmp(type, "INDEX") == 0)
311311
fprintf(stderr, _("%s: reindexing of index \"%s\" in database \"%s\" failed: %s"),
312312
progname, name, PQdb(conn), PQerrorMessage(conn));
313-
if (strcmp(type, "SCHEMA") == 0)
313+
else if (strcmp(type, "SCHEMA") == 0)
314314
fprintf(stderr, _("%s: reindexing of schema \"%s\" in database \"%s\" failed: %s"),
315315
progname, name, PQdb(conn), PQerrorMessage(conn));
316316
else

0 commit comments

Comments
 (0)