Re: pgsql: Allow concurrent-safe open() and fopen() in frontendcode for Wi - Mailing list pgsql-hackers

From Laurenz Albe
Subject Re: pgsql: Allow concurrent-safe open() and fopen() in frontendcode for Wi
Date
Msg-id 71bf47219037a5e3839748eb55e4fa175b58f523.camel@cybertec.at
Whole thread Raw
In response to Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi
List 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



pgsql-hackers by date:

Previous
From: Jinhua Luo
Date:
Subject: Is it really difficult for postgres_fdw to implement READ COMMITTED isolation?
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] proposal - Default namespaces for XPath expressions (PostgreSQL 11)