Re: Replace open mode with PG_BINARY_R/W/A macros - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Replace open mode with PG_BINARY_R/W/A macros
Date
Msg-id 3630418.1650597703@sss.pgh.pa.us
Whole thread Raw
In response to Re: Replace open mode with PG_BINARY_R/W/A macros  (Japin Li <japinli@hotmail.com>)
List pgsql-hackers
Japin Li <japinli@hotmail.com> writes:
> I think we should also consider the popen() (see: OpenPipeStream() function),
> on the Windows, it can use "b", however,  for linux, it might be not right.

Oh, ugh ... POSIX says for popen():

    The behavior of popen() is specified for values of mode of r and
    w. Other modes such as rb and wb might be supported by specific
    implementations, but these would not be portable features. Note
    that historical implementations of popen() only check to see if
    the first character of mode is r. Thus, a mode of robert the robot
    would be treated as mode r, and a mode of anything else would be
    treated as mode w.

Maybe it's best to leave well enough alone here.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Yugo NAGATA
Date:
Subject: Re: Implementing Incremental View Maintenance
Next
From: "bucoo"
Date:
Subject: Re: fix cost subqueryscan wrong parallel cost