Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>,
pgsql-hackers@lists.postgresql.org
Date: 2018-09-19T15:55:01Z
Lists: pgsql-hackers
Michael Paquier <michael@paquier.xyz> 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
Commits
-
Enforce translation mode for Windows frontends to text with open/fopen
- 40cfe86068f4 12.0 landed
-
Fix pgbench lexer's "continuation" rule to cope with Windows newlines.
- db37ab2c60b8 12.0 landed
- d45f157e8b07 11.0 landed
- 3ea7e015f37a 10.6 landed
-
Allow concurrent-safe open() and fopen() in frontend code for Windows
- 0ba06e0bfb8c 12.0 cited