Improvement of log messages in pg_basebackup

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Improvement of log messages in pg_basebackup
Date: 2012-03-27 09:25:27
Message-ID: CAHGQGwEbvxuDSCoT6EG+RiEp7-O6Wp+ozzEYnJmpmfsYpc9yqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
improve_pg_basebackup_log_messages_v1.patch text/x-diff 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2012-03-27 09:36:54 Re: pgsql_fdw, FDW for PostgreSQL server
Previous Message Noah Misch 2012-03-27 09:04:30 Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)