From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: kensuke.okamura@kantei.co.jp
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16688: psql removes only LF without CR at end of backquotes on windows.
Date: Wed, 28 Oct 2020 14:39:39 -0400
Message-ID: <1441558.1603910379@sss.pgh.pa.us> (raw)
In-Reply-To: <20201028032942.GA21830@momjian.us>
References: <16688-c649c7b69cd7e6f8@postgresql.org>
<1224124.1603855625@sss.pgh.pa.us>
<20201028032942.GA21830@momjian.us>
Bruce Momjian <bruce@momjian.us> writes:
> On Tue, Oct 27, 2020 at 11:27:05PM -0400, Tom Lane wrote:
>> But rather than mess with that newline-chomping code, I'm
>> inclined to wonder why we're using PG_BINARY_R for input
>> that we clearly expect to be textual. Most of our other
>> popen's do not do that.
>>
>> Bruce, this seems to date to 98e9775a3 ... don't suppose
>> you remember that? I see the point about control-Z in text
>> files, but I wonder how plausible that is for popen cases.
> It seems safe for popen to use TEXT mode, and it might help with
> encoding conversion. I don't think I made a popen distinction when I
> was working in this area.
I double-checked, and verified that our only other popen() calls
that use binary mode are dealing with COPY data. It seems appropriate
to do so in that case, partly because the data might indeed be binary
and partly because we have adequate newline recognition logic in copy.c.
But it does seem best to uniformly use plain "r" or "w" for other
popen's. So I've fixed this that way.
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, kensuke.okamura@kantei.co.jp, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16688: psql removes only LF without CR at end of backquotes on windows.
In-Reply-To: <1441558.1603910379@sss.pgh.pa.us>
* 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