Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHqZx-0007Lu-MG for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Mar 2021 16:11:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHqZw-0006Et-G7 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Mar 2021 16:11:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHqZw-0006El-97 for pgsql-hackers@lists.postgresql.org; Thu, 04 Mar 2021 16:11:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHqZu-0006PW-AY for pgsql-hackers@postgresql.org; Thu, 04 Mar 2021 16:11:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 124GBdoC1361845; Thu, 4 Mar 2021 11:11:39 -0500 From: Tom Lane To: Heikki Linnakangas cc: Michael Paquier , Alvaro Herrera , pgsql-hackers Subject: Re: Removing support for COPY FROM STDIN in protocol version 2 In-reply-to: <8a174f9b-59e4-e231-5b66-1f01b314882a@iki.fi> References: <20210203160958.GA2341@alvherre.pgsql> <3921698.1612369777@sss.pgh.pa.us> <6d6dcead-71fa-d9f6-4aaa-41104af0f27c@iki.fi> <1318732.1614814378@sss.pgh.pa.us> <8a174f9b-59e4-e231-5b66-1f01b314882a@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Thu, 04 Mar 2021 10:59:41 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1361843.1614874299.1@sss.pgh.pa.us> Date: Thu, 04 Mar 2021 11:11:39 -0500 Message-ID: <1361844.1614874299@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Heikki Linnakangas 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