Heikki Linnakangas <[email protected]> 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