Skip to content

Commit 8096be2

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 bae31e7 commit 8096be2

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
@@ -193,8 +193,7 @@ GetConnection(void)
193193

194194
if (PQstatus(tmpconn) != CONNECTION_OK)
195195
{
196-
fprintf(stderr, _("%s: could not connect to server: %s"),
197-
progname, PQerrorMessage(tmpconn));
196+
fprintf(stderr, _("%s: %s"), progname, PQerrorMessage(tmpconn));
198197
PQfinish(tmpconn);
199198
free(values);
200199
free(keywords);

src/bin/pg_rewind/libpq_fetch.c

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

5656
conn = PQconnectdb(connstr);
5757
if (PQstatus(conn) == CONNECTION_BAD)
58-
pg_fatal("could not connect to server: %s",
59-
PQerrorMessage(conn));
58+
pg_fatal("%s", PQerrorMessage(conn));
6059

6160
pg_log(PG_PROGRESS, "connected to server\n");
6261

0 commit comments

Comments
 (0)