From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Removing support for COPY FROM STDIN in protocol version 2
Date: Thu, 04 Mar 2021 11:11:39 -0500
Message-ID: <1361844.1614874299@sss.pgh.pa.us> (raw)
In-Reply-To: <8a174f9b-59e4-e231-5b66-1f01b314882a@iki.fi>
References: <20210203160958.GA2341@alvherre.pgsql>
<3921698.1612369777@sss.pgh.pa.us>
<YBuaJXBJOPRVCA5I@paquier.xyz>
<6d6dcead-71fa-d9f6-4aaa-41104af0f27c@iki.fi>
<1318732.1614814378@sss.pgh.pa.us>
<8a174f9b-59e4-e231-5b66-1f01b314882a@iki.fi>
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> On 04/03/2021 01:32, Tom Lane wrote:
>> I'm not sure where the extra newlines are coming from, and it seems
>> unlikely to be worth worrying over. This behavior is good enough for me.
> fe-connect.c appends a newline for any errors in pre-3.0 format:
>> /*
>> * The postmaster typically won't end its message with a
>> * newline, so add one to conform to libpq conventions.
>> */
>> appendPQExpBufferChar(&conn->errorMessage, '\n');
> That comment is wrong. The postmaster *does* end all its error messages
> with a newline. This changed in commit 9b4bfbdc2c in 7.2.
Ah-hah, and the bit you show here came in with 2af360ed1, in 7.0.
I'm surprised though that we didn't notice that the newline was now
usually redundant. This was a commonly taken code path until 7.4.
Anyway, your fix seems fine ... I wonder if we should back-patch it?
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, hlinnaka@iki.fi, michael@paquier.xyz, alvherre@alvh.no-ip.org
Subject: Re: Removing support for COPY FROM STDIN in protocol version 2
In-Reply-To: <1361844.1614874299@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