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 1odjJD-00049i-KP for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Sep 2022 02:29:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1odjJB-0007SK-Vn for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Sep 2022 02:29:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odjJB-0007SB-Mv for pgsql-hackers@lists.postgresql.org; Thu, 29 Sep 2022 02:29:53 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odjJ4-0005Am-Tk for pgsql-hackers@lists.postgresql.org; Thu, 29 Sep 2022 02:29:52 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 7575160853; Thu, 29 Sep 2022 11:29:40 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.7 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 29 Sep 2022 11:29:40 +0900 From: bt22nakamorit To: torikoshia Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Make ON_ERROR_STOP stop on shell script failure In-Reply-To: <6fd74d4bf62664b0320cde3f7a48f522@oss.nttdata.com> References: <20220916.173035.322733707258561235.horikyota.ntt@gmail.com> <4c61d434cb72b2237b3279797b2a387f@oss.nttdata.com> <8a022f2c8de93ea79116f0b7eb42248a@oss.nttdata.com> <6fd74d4bf62664b0320cde3f7a48f522@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <36360350378935c823a9dbbff5b2e54e@oss.nttdata.com> X-Sender: bt22nakamorit@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 2022-09-28 21:49 に torikoshia さんは書きました: >> if (result == 127 || result == -1) >> { >> pg_log_error("\\!: failed"); >> return false; >> } >> else if (result != 0) { >> pg_log_error("command failed"); >> return false; > > Since it would be hard to understand the cause of failures from these > two messages, it might be better to clarify them in the messages. > > The former comes from failures of child process creation or execution > on it and the latter occurs when child process creation and execution > succeeded but the return code is not 0, doesn't it? > > > I also felt it'd be natural that the latter message also begins with > "\\!" since both message concerns with \!. > > How do you think? Thank you for the feedback! I agree that the messages should be more clear. \\!: command was not executed \\!: command failed Would these two messages be enough to describe the two cases? Tatsu