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

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi
Date: 2018-09-18 15:28:53
Message-ID: 71bf47219037a5e3839748eb55e4fa175b58f523.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Well, we have to do something. I have a report from EDB's packagers
> that in 11beta4, "initdb --pwfile" is failing on Windows (ie, one can't
> connect afterwards using the specified password). It seems nearly
> certain to me that the reason is that the file is read with
>
> FILE *pwf = fopen(pwfilename, "r");
>
> and so the \r isn't getting stripped from what's used as the password.

Perhaps there is something obvious that I'm missing, but it seems that
all the problems we observe are caused by frontend code suddenly defaulting
to binary mode when it was text mode before.

Would it be an option to have pgwin32_open default to text mode in
frontend code and to binary mode in backend code?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-09-18 15:38:57 Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi
Previous Message Tom Lane 2018-09-18 14:45:09 Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-09-18 15:33:38 Re: [HACKERS] proposal - Default namespaces for XPath expressions (PostgreSQL 11)
Previous Message Jinhua Luo 2018-09-18 14:58:20 Is it really difficult for postgres_fdw to implement READ COMMITTED isolation?