Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f3ad4fd

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 3459f41 commit f3ad4fd

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/bin/pg_basebackup/streamutil.c

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

200200
if (PQstatus(tmpconn) != CONNECTION_OK)
201201
{
202-
pg_log_error("could not connect to server: %s",
203-
PQerrorMessage(tmpconn));
202+
pg_log_error("%s", PQerrorMessage(tmpconn));
204203
PQfinish(tmpconn);
205204
free(values);
206205
free(keywords);

src/bin/pg_rewind/libpq_fetch.c

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

4848
conn = PQconnectdb(connstr);
4949
if (PQstatus(conn) == CONNECTION_BAD)
50-
pg_fatal("could not connect to server: %s",
51-
PQerrorMessage(conn));
50+
pg_fatal("%s", PQerrorMessage(conn));
5251

5352
if (showprogress)
5453
pg_log_info("connected to server");

src/bin/psql/startup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ main(int argc, char *argv[])
296296

297297
if (PQstatus(pset.db) == CONNECTION_BAD)
298298
{
299-
pg_log_error("could not connect to server: %s", PQerrorMessage(pset.db));
299+
pg_log_error("%s", PQerrorMessage(pset.db));
300300
PQfinish(pset.db);
301301
exit(EXIT_BADCONN);
302302
}

0 commit comments

Comments
 (0)