Hi,

>       fprintf(stderr, _("%s: could not identify system: %s\n"),
>                       progname, PQerrorMessage(conn));

Since PQerrorMessage() result includes a trailing newline, the above
log message in pg_basebackup doesn't need to include a trailing \n.
Attached patch gets rid of that \n.

>       res = PQgetResult(conn);
>       if (PQresultStatus(res) != PGRES_TUPLES_OK)
>       {
>               fprintf(stderr, _("%s: could not get WAL end position from 
> server\n"),
>                               progname);

ISTM it's worth including PQerrorMessage() result in the above log
message, to diagnose the cause of error. Attached patch does that.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
*** a/src/bin/pg_basebackup/pg_basebackup.c
--- b/src/bin/pg_basebackup/pg_basebackup.c
***************
*** 914,920 **** BaseBackup(void)
  	res = PQexec(conn, "IDENTIFY_SYSTEM");
  	if (PQresultStatus(res) != PGRES_TUPLES_OK)
  	{
! 		fprintf(stderr, _("%s: could not identify system: %s\n"),
  				progname, PQerrorMessage(conn));
  		disconnect_and_exit(1);
  	}
--- 914,920 ----
  	res = PQexec(conn, "IDENTIFY_SYSTEM");
  	if (PQresultStatus(res) != PGRES_TUPLES_OK)
  	{
! 		fprintf(stderr, _("%s: could not identify system: %s"),
  				progname, PQerrorMessage(conn));
  		disconnect_and_exit(1);
  	}
***************
*** 1049,1056 **** BaseBackup(void)
  	res = PQgetResult(conn);
  	if (PQresultStatus(res) != PGRES_TUPLES_OK)
  	{
! 		fprintf(stderr, _("%s: could not get WAL end position from server\n"),
! 				progname);
  		disconnect_and_exit(1);
  	}
  	if (PQntuples(res) != 1)
--- 1049,1056 ----
  	res = PQgetResult(conn);
  	if (PQresultStatus(res) != PGRES_TUPLES_OK)
  	{
! 		fprintf(stderr, _("%s: could not get WAL end position from server: %s"),
! 				progname, PQerrorMessage(conn));
  		disconnect_and_exit(1);
  	}
  	if (PQntuples(res) != 1)
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to