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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: "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-18 14:41:32
Message-ID: 2271354.1650292892@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Japin Li <japinli(at)hotmail(dot)com> writes:
> I found we defined PG_BINARY_R/W/A macros for opening files, however,
> there are some places use the constant strings. IMO we should use
> those macros instead of constant strings. Here is a patch for it.
> Any thoughts?

A lot of these changes look wrong to me: they are substituting "rb" for
"r", etc, in places that mean to read text files. You have to think
about the Windows semantics.

If you think any of those changes are correct, then they are bug fixes
that need to be considered separately from cosmetic tidying.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-04-18 14:44:22 Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)
Previous Message Andres Freund 2022-04-18 14:39:01 Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)