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
if (PQstatus(tmpconn) != CONNECTION_OK)
{
- fprintf(stderr, _("%s: could not connect to server: %s"),
- progname, PQerrorMessage(tmpconn));
+ fprintf(stderr, _("%s: %s"), progname, PQerrorMessage(tmpconn));
PQfinish(tmpconn);
free(values);
free(keywords);
conn = PQconnectdb(connstr);
if (PQstatus(conn) == CONNECTION_BAD)
- pg_fatal("could not connect to server: %s",
- PQerrorMessage(conn));
+ pg_fatal("%s", PQerrorMessage(conn));
pg_log(PG_PROGRESS, "connected to server\n");