Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-02 Thread Noah Misch
On Thu, May 01, 2014 at 11:07:51PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Thu, May 01, 2014 at 08:44:46PM -0400, Tom Lane wrote: > >> You're only considering one aspect of the problem. Yeah, you might not > >> get duplicated output unless system() prints something before exec(), > >>

Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Tom Lane
Noah Misch writes: > On Thu, May 01, 2014 at 08:44:46PM -0400, Tom Lane wrote: >> You're only considering one aspect of the problem. Yeah, you might not >> get duplicated output unless system() prints something before exec(), >> but we would also like to have causality: that is, whatever we sent

Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Noah Misch
On Thu, May 01, 2014 at 08:44:46PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Thu, May 01, 2014 at 05:59:08PM -0400, Tom Lane wrote: > >> However ... after looking around I notice that fflush(NULL) is already > >> being used in parallel pg_dump and pg_upgrade; and at least in the latter >

Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Tom Lane
Noah Misch writes: > On Thu, May 01, 2014 at 05:59:08PM -0400, Tom Lane wrote: >> However ... after looking around I notice that fflush(NULL) is already >> being used in parallel pg_dump and pg_upgrade; and at least in the latter >> case I'm afraid to change that because it looks like there are pr

Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Noah Misch
On Thu, May 01, 2014 at 05:59:08PM -0400, Tom Lane wrote: > I wrote: > > Noah Misch writes: > >> Modern systems have other fflush(NULL) problems: > > >> http://www.nntp.perl.org/group/perl.perl5.porters/2013/09/msg207692.html > >> http://perl5.git.perl.org/metaconfig.git/blob/master:/U/perl/fflus

Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Robert Haas
On Thu, May 1, 2014 at 5:59 PM, Tom Lane wrote: > I wrote: >> Noah Misch writes: >>> On Thu, May 01, 2014 at 12:13:28PM -0400, Tom Lane wrote: Is there any reason not to change this to just fflush(NULL)? We dropped support for SunOS 4.1 quite some time ago ... > >>> Modern systems have

Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Tom Lane
I wrote: > Noah Misch writes: >> On Thu, May 01, 2014 at 12:13:28PM -0400, Tom Lane wrote: >>> Is there any reason not to change this to just fflush(NULL)? We dropped >>> support for SunOS 4.1 quite some time ago ... >> Modern systems have other fflush(NULL) problems: >> http://www.nntp.perl.or

Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Tom Lane
Noah Misch writes: > On Thu, May 01, 2014 at 12:13:28PM -0400, Tom Lane wrote: >> Is there any reason not to change this to just fflush(NULL)? We dropped >> support for SunOS 4.1 quite some time ago ... > Modern systems have other fflush(NULL) problems: > http://www.nntp.perl.org/group/perl.per

Re: [HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Noah Misch
On Thu, May 01, 2014 at 12:13:28PM -0400, Tom Lane wrote: > fork_process.c quoth: > > /* > * Flush stdio channels just before fork, to avoid double-output problems. > * Ideally we'd use fflush(NULL) here, but there are still a few non-ANSI > * stdio libraries out there (like Sun

[HACKERS] Obsolete coding in fork_process.c

2014-05-01 Thread Tom Lane
fork_process.c quoth: /* * Flush stdio channels just before fork, to avoid double-output problems. * Ideally we'd use fflush(NULL) here, but there are still a few non-ANSI * stdio libraries out there (like SunOS 4.1.x) that coredump if we do. * Presently stdout and stderr a