Re: Removing support for COPY FROM STDIN in protocol version 2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Removing support for COPY FROM STDIN in protocol version 2
Date: 2021-03-04 16:11:39
Message-ID: 1361844.1614874299@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <hlinnaka(at)iki(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2021-03-04 16:19:18 Re: Improvements and additions to COPY progress reporting
Previous Message Andrew Dunstan 2021-03-04 16:10:19 Re: buildfarm windows checks / tap tests on windows