Re: pg_rewind and log messages

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_rewind and log messages
Date: 2015-04-07 20:53:20
Message-ID: 20150407205320.GN4369@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 general. But there's also precedent in printing some stuff to
> stdout: pg_ctl does that for the status message, like "server starting". As
> does initdb.
>
> I'm pretty unclear on what the rule here is.

One principle that sometimes helps is to consider what happens if you
use the command as part of a larger pipeline; progress messages can be
read by some other command further down (and perhaps report them in a
dialog box, if you embed the program in a GUI, say), but error messages
should probably be processed differently; normally the pipeline would be
aborted as a whole.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2015-04-07 21:05:26 Re: pg_restore -t should match views, matviews, and foreign tables
Previous Message Heikki Linnakangas 2015-04-07 20:39:04 Re: pg_rewind and log messages