pgsql: Fix pg_recvlogical not to fsync output when it's a tty or pipe. - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: Fix pg_recvlogical not to fsync output when it's a tty or pipe.
Date
Msg-id E1ZCQq1-0006NX-9i@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix pg_recvlogical not to fsync output when it's a tty or pipe.

The previous coding tried to handle possible failures when fsyncing a
tty or pipe fd by accepting EINVAL - but apparently some
platforms (windows, OSX) don't reliably return that. So instead check
whether the output fd refers to a pipe or a tty when opening it.

Reported-By: Olivier Gosseaume, Marko Tiikkaja
Discussion: 559AF98B.3050901@joh.to

Backpatch to 9.4, where pg_recvlogical was added.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1790b35baf52fff7f670f7cc1159a1b40b36e701

Modified Files
--------------
src/bin/pg_basebackup/pg_recvlogical.c |   17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: Fix logical decoding bug leading to inefficient reopening of fil
Next
From: Andres Freund
Date:
Subject: pgsql: Fix logical decoding bug leading to inefficient reopening of fil