aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2020-11-07 22:15:52 +0100
committerPeter Eisentraut <peter@eisentraut.org>2020-11-07 22:42:17 +0100
commit16eadc4695ef120e5a6f6adf026a034e291806cc (patch)
tree2ffd179f359762258ea2d6efc6a901f2456883f6 /src
parent8ad6a0c1bb1c5a041cadfed713ef6bcabd0955ab (diff)
downloadpostgresql-16eadc4695ef120e5a6f6adf026a034e291806cc.tar.gz
postgresql-16eadc4695ef120e5a6f6adf026a034e291806cc.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_basebackup/streamutil.c3
-rw-r--r--src/bin/pg_rewind/libpq_fetch.c3
-rw-r--r--src/bin/psql/startup.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index 6f9473bc55d..e6b062f316d 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -201,8 +201,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 0dae75b8628..97b1017a499 100644
--- a/src/bin/pg_rewind/libpq_fetch.c
+++ b/src/bin/pg_rewind/libpq_fetch.c
@@ -49,8 +49,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 e4c0a7eacbf..67653ae75f8 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -300,7 +300,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);
}