mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
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
This commit is contained in:
parent
3459f4169b
commit
f3ad4fddfa
3 changed files with 3 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue