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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Replace open mode with PG_BINARY_R/W/A macros
Дата
Msg-id 2503493.1650349233@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Replace open mode with PG_BINARY_R/W/A macros  (Japin Li <japinli@hotmail.com>)
Ответы Re: Replace open mode with PG_BINARY_R/W/A macros  (Japin Li <japinli@hotmail.com>)
Список pgsql-hackers
Japin Li <japinli@hotmail.com> writes:
> On Mon, 18 Apr 2022 at 22:41, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

> I do this substituting, since the comment says it can be used for opening
> text files.  Maybe I misunderstand the comment.

I think the comment's at best misleading.  See e.g. 66f8687a8.
It might be okay to use "rb" to read a text file when there
is actually \r-stripping logic present, but you need to check
that.  Using "wb" to write a text file is flat wrong.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Replace open mode with PG_BINARY_R/W/A macros
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Perform streaming logical transactions by background workers and parallel apply