Skip to content

Commit 42c088b

Browse files
committed
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
1 parent 895d0f0 commit 42c088b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/bin/pg_basebackup/streamutil.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ GetConnection(void)
201201

202202
if (PQstatus(tmpconn) != CONNECTION_OK)
203203
{
204-
fprintf(stderr, _("%s: could not connect to server: %s"),
205-
progname, PQerrorMessage(tmpconn));
204+
fprintf(stderr, _("%s: %s"), progname, PQerrorMessage(tmpconn));
206205
PQfinish(tmpconn);
207206
free(values);
208207
free(keywords);

src/bin/pg_rewind/libpq_fetch.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ libpqConnect(const char *connstr)
5050

5151
conn = PQconnectdb(connstr);
5252
if (PQstatus(conn) == CONNECTION_BAD)
53-
pg_fatal("could not connect to server: %s",
54-
PQerrorMessage(conn));
53+
pg_fatal("%s", PQerrorMessage(conn));
5554

5655
pg_log(PG_PROGRESS, "connected to server\n");
5756

0 commit comments

Comments
 (0)