Re: Replace open mode with PG_BINARY_R/W/A macros

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Japin Li <japinli(at)hotmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Replace open mode with PG_BINARY_R/W/A macros
Date: 2022-04-21 20:25:13
Message-ID: 4e7545a9-7cba-6be2-0a6e-72a0f531184a@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-04-21 20:36:01 Re: [RFC] building postgres with meson -v8
Previous Message Robert Haas 2022-04-21 20:24:24 Re: BufferAlloc: don't take two simultaneous locks