Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5xkC-00GEm3-IB for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Nov 2023 00:39:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r5xkA-00Do3i-EH for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Nov 2023 00:38:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5xkA-00Do1d-3n for pgsql-hackers@lists.postgresql.org; Thu, 23 Nov 2023 00:38:58 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5xk7-007uQy-Df for pgsql-hackers@postgresql.org; Thu, 23 Nov 2023 00:38:57 +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 3AN0cqms2543636; Wed, 22 Nov 2023 19:38:52 -0500 From: Tom Lane To: Bruce Momjian cc: Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [HACKERS] psql casts aspersions on server reliability In-reply-to: References: <15946.1475068481@sss.pgh.pa.us> Comments: In-reply-to Bruce Momjian message dated "Wed, 22 Nov 2023 19:11:41 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2543634.1700699932.1@sss.pgh.pa.us> Date: Wed, 22 Nov 2023 19:38:52 -0500 Message-ID: <2543635.1700699932@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bruce Momjian writes: > On Wed, Sep 28, 2016 at 09:14:41AM -0400, Tom Lane wrote: >> I could go along with just dropping the last sentence ("This probably...") >> if the last error we got was FATAL level. I don't find "unexpectedly" >> to be problematic here: from the point of view of psql, and probably >> of its user, the shutdown *was* unexpected. > I looked at this thread from 2016 and I think the problem is the > "abnormally" word, since if the server was shutdown by the administrator > (most likely), it isn't abnormal. Here is a patch to remove > "abnormally". I do not think this is an improvement. The places you are changing are reacting to a connection closure. *If* we had previously gotten a "FATAL: terminating connection due to administrator command" message, then yeah the connection closure is expected; but if not, it isn't. Your patch adds no check for that. (As I remarked in 2016, we could probably condition this on the elevel being FATAL, rather than checking for specific error messages.) regards, tom lane