Re: pgsql: Allow concurrent-safe open() and fopen() in frontend codefor Wi

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pgsql: Allow concurrent-safe open() and fopen() in frontend codefor Wi
Дата
Msg-id 20180918024227.GI31460@paquier.xyz
обсуждение исходный текст
Ответ на Re: pgsql: Allow concurrent-safe open() and fopen() in frontend codefor Wi  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Sep 18, 2018 at 09:11:43AM +0900, Michael Paquier wrote:
> What I think I broke is that CreateFile ignores what _fmode uses, which
> has caused the breakage, while calling directly open() or fopen() does
> the work.  There are also other things assuming that binary mode is
> used, you can grep for "setmode" and see how miscinit.c or pg_basebackup
> do the job.

I have been playing with this stuff, and hacked the attached.  Now, while
TAP tests of initdb and pgbench are happy (I can actually see the past
failure as well), pg_dump complains at authentication time when using
plain-text mode when using databases with all ASCII characters.  That's
not something I expected first, but _get_fmode also influences
operations like pipe(), which is something that pg_dump uses, and
setmode is enforced to binary mode only when adapted.

I am getting to wonder if what's present on HEAD represents actually the
best deal we could get.  Attached is the patch I used for reference.
Thoughts?
--
Michael

Вложения

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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Problem while setting the fpw with SIGHUP
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Changing the setting of wal_sender_timeout per standby