Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6be725e

Browse filesBrowse files
committed
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
1 parent eed4356 commit 6be725e
Copy full SHA for 6be725e

File tree

Expand file treeCollapse file tree

3 files changed

+3
-5
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+3
-5
lines changed

‎src/bin/pg_basebackup/streamutil.c

Copy file name to clipboardExpand all lines: src/bin/pg_basebackup/streamutil.c
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ GetConnection(void)
200200

201201
if (PQstatus(tmpconn) != CONNECTION_OK)
202202
{
203-
pg_log_error("could not connect to server: %s",
204-
PQerrorMessage(tmpconn));
203+
pg_log_error("%s", PQerrorMessage(tmpconn));
205204
PQfinish(tmpconn);
206205
free(values);
207206
free(keywords);

‎src/bin/pg_rewind/pg_rewind.c

Copy file name to clipboardExpand all lines: src/bin/pg_rewind/pg_rewind.c
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ main(int argc, char **argv)
282282
conn = PQconnectdb(connstr_source);
283283

284284
if (PQstatus(conn) == CONNECTION_BAD)
285-
pg_fatal("could not connect to server: %s",
286-
PQerrorMessage(conn));
285+
pg_fatal("%s", PQerrorMessage(conn));
287286

288287
if (showprogress)
289288
pg_log_info("connected to server");

‎src/bin/psql/startup.c

Copy file name to clipboardExpand all lines: src/bin/psql/startup.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ main(int argc, char *argv[])
295295

296296
if (PQstatus(pset.db) == CONNECTION_BAD)
297297
{
298-
pg_log_error("could not connect to server: %s", PQerrorMessage(pset.db));
298+
pg_log_error("%s", PQerrorMessage(pset.db));
299299
PQfinish(pset.db);
300300
exit(EXIT_BADCONN);
301301
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.