Skip to content

Commit 16eadc4

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 8ad6a0c commit 16eadc4

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

202202
if (PQstatus(tmpconn) != CONNECTION_OK)
203203
{
204-
pg_log_error("could not connect to server: %s",
205-
PQerrorMessage(tmpconn));
204+
pg_log_error("%s", 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
@@ -49,8 +49,7 @@ libpqConnect(const char *connstr)
4949

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

5554
if (showprogress)
5655
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
@@ -300,7 +300,7 @@ main(int argc, char *argv[])
300300

301301
if (PQstatus(pset.db) == CONNECTION_BAD)
302302
{
303-
pg_log_error("could not connect to server: %s", PQerrorMessage(pset.db));
303+
pg_log_error("%s", PQerrorMessage(pset.db));
304304
PQfinish(pset.db);
305305
exit(EXIT_BADCONN);
306306
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy