From: Peter Eisentraut Date: Sat, 7 Nov 2020 21:15:52 +0000 (+0100) Subject: Fix redundant error messages in client tools X-Git-Tag: REL9_5_24~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24bbdaa6feace76768b398ddcbbef6efcc2db45a;p=thirdparty%2Fpostgresql.git Fix redundant error messages in client tools A few client tools duplicate error messages already provided by libpq. Discussion: https://www.postgresql.org/message-id/flat/3e937641-88a1-e697-612e-99bba4b8e5e4%40enterprisedb.com --- diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c index b4fa9f59d25..23ef13abdc3 100644 --- a/src/bin/pg_basebackup/streamutil.c +++ b/src/bin/pg_basebackup/streamutil.c @@ -193,8 +193,7 @@ GetConnection(void) if (PQstatus(tmpconn) != CONNECTION_OK) { - fprintf(stderr, _("%s: could not connect to server: %s"), - progname, PQerrorMessage(tmpconn)); + fprintf(stderr, _("%s: %s"), progname, PQerrorMessage(tmpconn)); PQfinish(tmpconn); free(values); free(keywords); diff --git a/src/bin/pg_rewind/libpq_fetch.c b/src/bin/pg_rewind/libpq_fetch.c index bb5a83648a4..f7e844cd6c2 100644 --- a/src/bin/pg_rewind/libpq_fetch.c +++ b/src/bin/pg_rewind/libpq_fetch.c @@ -55,8 +55,7 @@ libpqConnect(const char *connstr) conn = PQconnectdb(connstr); if (PQstatus(conn) == CONNECTION_BAD) - pg_fatal("could not connect to server: %s", - PQerrorMessage(conn)); + pg_fatal("%s", PQerrorMessage(conn)); pg_log(PG_PROGRESS, "connected to server\n");