]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix redundant error messages in client tools
authorPeter Eisentraut <peter@eisentraut.org>
Sat, 7 Nov 2020 21:15:52 +0000 (22:15 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Sat, 7 Nov 2020 21:44:15 +0000 (22:44 +0100)
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

src/bin/pg_basebackup/streamutil.c
src/bin/pg_rewind/libpq_fetch.c

index e9a2739f8e2a67b48e2da64c5a4080bb11c6edd6..9309a8de95536e260ffb9b862ca08e7cb32ed70a 100644 (file)
@@ -201,8 +201,7 @@ GetConnection(void)
 
        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);
index fea7a2213905c607734e9066c6b3a6f6a44182ad..361565d8612b8abeb4415d26259b458a4ac32895 100644 (file)
@@ -50,8 +50,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));
 
        pg_log(PG_PROGRESS, "connected to server\n");