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 1odWVS-0000bL-7f for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Sep 2022 12:49:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1odWVQ-0006ZY-76 for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Sep 2022 12:49:40 +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 1odWVP-0006Xm-Sz for pgsql-hackers@lists.postgresql.org; Wed, 28 Sep 2022 12:49:39 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odWVL-0001o5-Nn for pgsql-hackers@lists.postgresql.org; Wed, 28 Sep 2022 12:49:38 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 46CE160743; Wed, 28 Sep 2022 21:49:30 +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: Wed, 28 Sep 2022 21:49:30 +0900 From: torikoshia To: bt22nakamorit Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Make ON_ERROR_STOP stop on shell script failure In-Reply-To: <8a022f2c8de93ea79116f0b7eb42248a@oss.nttdata.com> References: <20220916.173035.322733707258561235.horikyota.ntt@gmail.com> <4c61d434cb72b2237b3279797b2a387f@oss.nttdata.com> <8a022f2c8de93ea79116f0b7eb42248a@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <6fd74d4bf62664b0320cde3f7a48f522@oss.nttdata.com> X-Sender: torikoshia@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-09-20 15:15, bt22nakamorit wrote: > I edited the documentation for ON_ERROR_STOP. > Any other suggestions? Thanks for the patch! > 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? -- Regards, -- Atsushi Torikoshi NTT DATA CORPORATION