Re: Replace open mode with PG_BINARY_R/W/A macros
| От | Peter Eisentraut |
|---|---|
| Тема | Re: Replace open mode with PG_BINARY_R/W/A macros |
| Дата | |
| Msg-id | 96c9ecac-9d8a-23e8-7cad-5ca1f4d2683d@enterprisedb.com обсуждение исходный текст |
| Ответ на | Re: Replace open mode with PG_BINARY_R/W/A macros (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Replace open mode with PG_BINARY_R/W/A macros
|
| Список | pgsql-hackers |
On 19.04.22 16:21, Tom Lane wrote: > * In the other direction, decide that the PG_BINARY_X macros are > offering no benefit at all and just rip 'em out, writing "rb" and > so on in their place. POSIX specifies that the character "b" has > no effect on Unix-oid systems, and it has said that for thirty years > now, so we do not really need the platform dependency that presently > exists in the macro definitions. The presence or absence of "b" > would serve fine as an indicator of intent, and there would be one > less PG-specific coding convention to remember. I can only imagine that there must have been some Unix systems that did not understand the "binary" APIs required for Windows. (For example, neither the Linux nor the macOS open(2) man page mentions O_BINARY.) Otherwise, these macros don't make any sense, because then you could just write the thing directly on all platforms.
В списке pgsql-hackers по дате отправления: