Re: [HACKERS] pg_rewind and log messages

2015-04-07 Thread Fujii Masao
On Tue, Apr 7, 2015 at 11:59 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Mon, Apr 6, 2015 at 9:10 PM, Fujii Masao masao.fu...@gmail.com wrote: I'm not familiar with native language support (sorry), but don't we need to add the shortcut of gettext into every calls of pg_log and

Re: [HACKERS] pg_rewind and log messages

2015-04-07 Thread Michael Paquier
On Tue, Apr 7, 2015 at 4:33 PM, Fujii Masao wrote: Isn't the term PostgreSQL superuser confusing? I'm afraid that a user might confuse PostgreSQL superuser with a database superuser. I see you just borrowed that term from pg_resetxlog.c, though. BTW, initdb and pg_ctl also have the same check

Re: [HACKERS] pg_rewind and log messages

2015-04-07 Thread Michael Paquier
On Tue, Apr 7, 2015 at 4:16 PM, Fujii Masao masao.fu...@gmail.com wrote: On Mon, Apr 6, 2015 at 10:01 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Fujii Masao wrote: On Mon, Apr 6, 2015 at 5:33 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Mon, Apr 6, 2015 at 1:41 PM,

Re: [HACKERS] pg_rewind and log messages

2015-04-07 Thread Fujii Masao
On Mon, Apr 6, 2015 at 10:01 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Fujii Masao wrote: On Mon, Apr 6, 2015 at 5:33 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Mon, Apr 6, 2015 at 1:41 PM, Michael Paquier wrote: I guess that you are working on a patch? If not, you are

Re: [HACKERS] pg_rewind and log messages

2015-04-07 Thread Heikki Linnakangas
On 04/07/2015 05:59 AM, Michael Paquier wrote: On Mon, Apr 6, 2015 at 9:10 PM, Fujii Masao masao.fu...@gmail.com wrote: I eliminated a bunch of newlines in the log messages that seemed really unnecessary to me, simplifying a bit the whole. So the patch removed the newlines from the error

Re: [HACKERS] pg_rewind and log messages

2015-04-07 Thread Alvaro Herrera
Heikki Linnakangas wrote: On 04/07/2015 05:59 AM, Michael Paquier wrote: Fix inconsistent handling of logs in pg_rewind pg_rewind was handling a couple of things differently compared to the other src/bin utilities: - Logging output needs to be flushed on stderr, not stdout Agreed in

Re: [HACKERS] pg_rewind and log messages

2015-04-07 Thread Fujii Masao
On Wed, Apr 8, 2015 at 5:53 AM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Heikki Linnakangas wrote: On 04/07/2015 05:59 AM, Michael Paquier wrote: Fix inconsistent handling of logs in pg_rewind pg_rewind was handling a couple of things differently compared to the other src/bin

Re: [HACKERS] pg_rewind and log messages

2015-04-06 Thread Michael Paquier
On Mon, Apr 6, 2015 at 10:01 PM, Alvaro Herrera wrote: I'm not sure about translation of generic strings such as %s: %s. My first impression is that they shouldn't be translated, but maybe it is important that they are for languages I don't know nothing about such as Japanese. I

Re: [HACKERS] pg_rewind and log messages

2015-04-06 Thread Michael Paquier
On Mon, Apr 6, 2015 at 9:10 PM, Fujii Masao masao.fu...@gmail.com wrote: I'm not familiar with native language support (sorry), but don't we need to add the shortcut of gettext into every calls of pg_log and pg_fatal, e.g., change pg_fatal(xxx) to pg_fatal(_(xxx))? I know that fprintf() in

Re: [HACKERS] pg_rewind and log messages

2015-04-06 Thread Michael Paquier
On Mon, Apr 6, 2015 at 1:41 PM, Michael Paquier wrote: I guess that you are working on a patch? If not, you are looking for one? Code-speaking, this gives the patch attached. I eliminated a bunch of newlines in the log messages that seemed really unnecessary to me, simplifying a bit the whole.

Re: [HACKERS] pg_rewind and log messages

2015-04-06 Thread Alvaro Herrera
Fujii Masao wrote: On Mon, Apr 6, 2015 at 5:33 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Mon, Apr 6, 2015 at 1:41 PM, Michael Paquier wrote: I guess that you are working on a patch? If not, you are looking for one? Code-speaking, this gives the patch attached. Thanks!

Re: [HACKERS] pg_rewind and log messages

2015-04-06 Thread Fujii Masao
On Mon, Apr 6, 2015 at 5:33 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Mon, Apr 6, 2015 at 1:41 PM, Michael Paquier wrote: I guess that you are working on a patch? If not, you are looking for one? Code-speaking, this gives the patch attached. Thanks! Here are the review comments:

Re: [HACKERS] pg_rewind and log messages

2015-04-05 Thread Michael Paquier
On Mon, Apr 6, 2015 at 12:57 PM, Fujii Masao masao.fu...@gmail.com wrote: (1) It outputs an error message to stdout not stderr. (2) The tool name should be added at the head of log message as follows, but not in pg_rewind. pg_basebackup: no target directory specified Agreed. That's