Commit 6be725e7 authored by Peter Eisentraut's avatar Peter Eisentraut

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
parent eed4356f
...@@ -200,8 +200,7 @@ GetConnection(void) ...@@ -200,8 +200,7 @@ GetConnection(void)
if (PQstatus(tmpconn) != CONNECTION_OK) if (PQstatus(tmpconn) != CONNECTION_OK)
{ {
pg_log_error("could not connect to server: %s", pg_log_error("%s", PQerrorMessage(tmpconn));
PQerrorMessage(tmpconn));
PQfinish(tmpconn); PQfinish(tmpconn);
free(values); free(values);
free(keywords); free(keywords);
......
...@@ -282,8 +282,7 @@ main(int argc, char **argv) ...@@ -282,8 +282,7 @@ main(int argc, char **argv)
conn = PQconnectdb(connstr_source); conn = PQconnectdb(connstr_source);
if (PQstatus(conn) == CONNECTION_BAD) if (PQstatus(conn) == CONNECTION_BAD)
pg_fatal("could not connect to server: %s", pg_fatal("%s", PQerrorMessage(conn));
PQerrorMessage(conn));
if (showprogress) if (showprogress)
pg_log_info("connected to server"); pg_log_info("connected to server");
......
...@@ -295,7 +295,7 @@ main(int argc, char *argv[]) ...@@ -295,7 +295,7 @@ main(int argc, char *argv[])
if (PQstatus(pset.db) == CONNECTION_BAD) 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); PQfinish(pset.db);
exit(EXIT_BADCONN); exit(EXIT_BADCONN);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment