pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi
Date: Tue, 18 Sep 2018 18:04:58 +0200
Message-ID: <c68010480459c79f24a015096ae43b6f0bcd9854.camel@cybertec.at> (raw )
In-Reply-To: <25361.1537285137@sss.pgh.pa.us >
References: <23543.1536938575@sss.pgh.pa.us >
<20180914224939.GA1178@paquier.xyz >
<20180917114113.GA31460@paquier.xyz >
<17194.1537191697@sss.pgh.pa.us >
<20180917140202.GF31460@paquier.xyz >
<19655.1537195712@sss.pgh.pa.us >
<f62917d5-cc77-c6ac-847f-44f922ccdd97@2ndQuadrant.com >
<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 >
Tom Lane wrote:
> Laurenz Albe <laurenz.albe@cybertec.at> writes:
> > Would it be an option to have pgwin32_open default to text mode in
> > frontend code and to binary mode in backend code?
>
> Well, the question is why Michael's latest proposed patch doesn't
> accomplish that.
I was thinking of something trivial like this:
--- a/src/port/open.c
+++ b/src/port/open.c
@@ -71,6 +71,12 @@ pgwin32_open(const char *fileName, int fileFlags,...)
_O_SHORT_LIVED | O_DSYNC | O_DIRECT |
(O_CREAT | O_TRUNC | O_EXCL) | (O_TEXT | O_BINARY))) == fileFlags);
+#ifdef FRONTEND
+ /* default to text mode in frontend code */
+ if (fileFlags & O_BINARY == 0)
+ fileFlags |= O_TEXT;
+#endif
+
sa.nLength = sizeof(sa);
sa.bInheritHandle = TRUE;
sa.lpSecurityDescriptor = NULL;
That wouldn't influence pipes, which was what Michael said was a
problem for pg_dump.
I currently have no Windows system close, so I cannot test...
Yours,
Laurenz Albe
view thread (24+ messages) latest in thread
Message-ID: <c68010480459c79f24a015096ae43b6f0bcd9854.camel@cybertec.at>
Permalink: ../c68010480459c79f24a015096ae43b6f0bcd9854.camel@cybertec.at/
Also on: postgresql.org/message-id/c68010480459c79f24a015096ae43b6f0bcd9854.camel@cybertec.at
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi
In-Reply-To: <c68010480459c79f24a015096ae43b6f0bcd9854.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox