diff options
author | Peter Eisentraut | 2020-11-07 21:15:52 +0000 |
---|---|---|
committer | Peter Eisentraut | 2020-11-07 22:03:51 +0000 |
commit | f3ad4fddfaf71e8f6f037cd627f398ba43625ca1 (patch) | |
tree | 3aee262342dd765f24c25f546827bf22eb429778 | |
parent | 3459f4169ba9665fbc7965165ec4ef83170b748b (diff) |
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
-rw-r--r-- | src/bin/pg_basebackup/streamutil.c | 3 | ||||
-rw-r--r-- | src/bin/pg_rewind/libpq_fetch.c | 3 | ||||
-rw-r--r-- | src/bin/psql/startup.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c index c08003e7f2c..ad282ceb5dd 100644 --- a/src/bin/pg_basebackup/streamutil.c +++ b/src/bin/pg_basebackup/streamutil.c @@ -199,8 +199,7 @@ GetConnection(void) if (PQstatus(tmpconn) != CONNECTION_OK) { - pg_log_error("could not connect to server: %s", - PQerrorMessage(tmpconn)); + pg_log_error("%s", 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 bf4dfc23b96..f4706e9a95f 100644 --- a/src/bin/pg_rewind/libpq_fetch.c +++ b/src/bin/pg_rewind/libpq_fetch.c @@ -47,8 +47,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)); if (showprogress) pg_log_info("connected to server"); diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 3302bd4dd32..392b96eb862 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -296,7 +296,7 @@ main(int argc, char *argv[]) if (PQstatus(pset.db) == CONNECTION_BAD) { - pg_log_error("could not connect to server: %s", PQerrorMessage(pset.db)); + pg_log_error("%s", PQerrorMessage(pset.db)); PQfinish(pset.db); exit(EXIT_BADCONN); } |