Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2eoz-0006LB-Jq for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Sep 2018 15:55:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g2eox-0003lz-Oy for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Sep 2018 15:55:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2eox-0003lD-EE for pgsql-hackers@lists.postgresql.org; Wed, 19 Sep 2018 15:55:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2eoq-0004is-M1 for pgsql-hackers@lists.postgresql.org; Wed, 19 Sep 2018 15:55:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8JFt1Xa026883; Wed, 19 Sep 2018 11:55:01 -0400 From: Tom Lane To: Michael Paquier cc: Laurenz Albe , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi In-reply-to: <20180919023211.GC1650@paquier.xyz> References: <19655.1537195712@sss.pgh.pa.us> <3883.1537200836@sss.pgh.pa.us> <11148.1537227504@sss.pgh.pa.us> <20180918001143.GG31460@paquier.xyz> <20180918024227.GI31460@paquier.xyz> <23296.1537281909@sss.pgh.pa.us> <71bf47219037a5e3839748eb55e4fa175b58f523.camel@cybertec.at> <25361.1537285137@sss.pgh.pa.us> <20180919023211.GC1650@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Wed, 19 Sep 2018 11:32:11 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26881.1537372501.1@sss.pgh.pa.us> Date: Wed, 19 Sep 2018 11:55:01 -0400 Message-ID: <26882.1537372501@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > I have spent a large portion of my morning trying to test all the > solutions proposed, and a winner shows up. ... > - win32-open-laurenz.patch, which enforces to text mode only if binary > mode is not defined, which maps strictly to what pre-11 is doing when > calling the system _open or _fopen. And surprisingly, this is proving > to pass all the tests I ran: bincheck (including pgbench and pg_dump), > upgradecheck, recoverycheck, check, etc. initdb --pwfile is not > complaining to me either. I'm OK with this approach. I wonder though what happens if you take away the "#ifdef FRONTEND" and just enforce that one or the other mode is selected always. That would seem like a sensible solution rather than a wart to me ... regards, tom lane