pgsql: In initdb, ensure stdout/stderr buffering behavior is what we ex

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: In initdb, ensure stdout/stderr buffering behavior is what we ex
Date: 2014-05-15 01:14:38
Message-ID: E1WkkFq-0000bI-V0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

In initdb, ensure stdout/stderr buffering behavior is what we expect.

Since this program may print to either stdout or stderr, the relative
ordering of its messages depends on the buffering behavior of those files.
Force stdout to be line-buffered and stderr to be unbuffered, ensuring
that the behavior will match standard Unix interactive behavior, even
when stdout and stderr are rerouted to a file.

Per complaint from Tomas Vondra. The particular case he pointed out is
new in HEAD, but issues of the same sort could arise in any branch with
other error messages, so back-patch to all branches.

I'm unsure whether we might not want to do this in other client programs
as well. For the moment, just fix initdb.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4511e6c831e3d16303d6df183a00d33f5d6ba3e8

Modified Files
--------------
src/bin/initdb/initdb.c | 9 +++++++++
1 file changed, 9 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-05-15 01:14:39 pgsql: In initdb, ensure stdout/stderr buffering behavior is what we ex
Previous Message Bruce Momjian 2014-05-15 01:14:36 Re: pgsql: Fix version check for pg_upgrade line type crosscheck.