Skip to content

Commit 82ed20e

Browse files
committed
Fix error reporting in reindexdb
When failing to reindex a table, 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 b1cde67 commit 82ed20e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/scripts/reindexdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ reindex_one_database(const char *name, const char *dbname, const char *type,
264264
if (strcmp(type, "TABLE") == 0)
265265
fprintf(stderr, _("%s: reindexing of table \"%s\" in database \"%s\" failed: %s"),
266266
progname, name, PQdb(conn), PQerrorMessage(conn));
267-
if (strcmp(type, "INDEX") == 0)
267+
else if (strcmp(type, "INDEX") == 0)
268268
fprintf(stderr, _("%s: reindexing of index \"%s\" in database \"%s\" failed: %s"),
269269
progname, name, PQdb(conn), PQerrorMessage(conn));
270270
else

0 commit comments

Comments
 (0)