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 3478326.1650573499@sss.pgh.pa.us
Whole thread Raw
In response to Re: Replace open mode with PG_BINARY_R/W/A macros  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Responses Re: Replace open mode with PG_BINARY_R/W/A macros  (Japin Li <japinli@hotmail.com>)
List pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> On 20.04.22 22:29, Tom Lane wrote:
>> PG_BINARY is useful for open().  It's the PG_BINARY_R/W/A macros for
>> fopen() that are redundant per POSIX.  Possibly someone generalized
>> inappropriately; or maybe long ago we supported some platform that
>> rejected the "b" option?

> I think the latter was the case.  I doubt it's still a problem.

We could find that out with little effort, at least for machines in the
buildfarm, by modifying c.h to use the form with "b" always.

> I see some of the new code in pg_basebackup uses "wb" directly.  It 
> would probably be good to fix that to be consistent one way or the 
> other.  I vote for getting rid of the macros.

Yeah, I suspect there have been other inconsistencies for years :-(

            regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [RFC] building postgres with meson -v8
Next
From: Tomas Vondra
Date:
Subject: Re: Assert failure in CTE inlining with view and correlated subquery