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 1nCij6-000140-PX for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jan 2022 13:52:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCiia-0006hd-7v for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jan 2022 13:52:12 +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 1nCiiZ-0006hT-VH for pgsql-hackers@lists.postgresql.org; Wed, 26 Jan 2022 13:52:11 +0000 Received: from sfr-1.cri.mines-paristech.fr ([77.158.180.225] helo=smtp.cri.ensmp.fr) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCiiT-00029i-ER for pgsql-hackers@postgresql.org; Wed, 26 Jan 2022 13:52:11 +0000 Received: from petersbourg.cri.ensmp.fr (petersbourg.cri.ensmp.fr [10.2.14.5]) by smtp.cri.ensmp.fr (Postfix) with ESMTPSA id 0DD13C01F9; Wed, 26 Jan 2022 14:55:08 +0100 (CET) Date: Wed, 26 Jan 2022 14:52:03 +0100 (CET) From: Fabien COELHO X-X-Sender: fabien@pseudo To: Peter Eisentraut cc: pgsql-hackers Subject: Re: libpq async duplicate error results In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > command = SELECT pg_terminate_backend(pg_backend_pid()); > result 1 status = PGRES_FATAL_ERROR > error message = "FATAL: terminating connection due to administrator command > " > result 2 status = PGRES_FATAL_ERROR > error message = "FATAL: terminating connection due to administrator command > server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > " > Also, why are there multiple results being generated in the first place? My interpretation is that the first message is a close message issued by the server before actually severing the connection, and the second message is generated by libpq when it notices that the connection has been closed, so there is some sense in having to results to report these two consecutive errors, and the question might be about when the buffer should be reset. -- Fabien.