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 1o1P6H-0003gm-Gv for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Jun 2022 09:14:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o1P6G-0001rf-CR for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Jun 2022 09:14:08 +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 1o1P6G-0001rW-37 for pgsql-bugs@lists.postgresql.org; Wed, 15 Jun 2022 09:14:08 +0000 Received: from mail.credativ.com ([93.94.130.90]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o1P6C-00029o-O0 for pgsql-bugs@lists.postgresql.org; Wed, 15 Jun 2022 09:14:07 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.credativ.com (Postfix) with ESMTP id AEA3B20405; Wed, 15 Jun 2022 09:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=credativ.de; s=email; t=1655284442; bh=0bSaK7IAq9Sn8IIJQqEsHB4Gg4bRoc7aCcxJgkaGJkg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rfntzOfdN4dT64C9DdIkt12y2qRIZJvKQ6Wq8hIhehDewOdv3MElHKn9nbbNW8HPt OFisKLqvCAlYcY/k6iOWpIGv1qgjDAjQDnnLi3Pt8SRwnANWCmrJ7zo09dlDvHi5e0 D4/wvAiuxmfIFvwfRgZtfkXgsELE922bjtmy0MN46t5kUFBNQ9uKz/V/7zV6NXq8fz 63OKKxlPe5Jftwk5K3GUmLd3OojsmhCIlhExPS2CHkJGMewLOUpBgkjfdV+fxtM2+M 9tVwtHt/iCkV54q5ioQqIAJJYoRfgQdXP42aqe3xkdlmtW9EtzsCMjvIyUvMd3icnD dEgYtPGTPjlmA== Received: from mail.credativ.com ([127.0.0.1]) by localhost (mail.credativ.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Td_FSZ-NNoOl; Wed, 15 Jun 2022 09:13:56 +0000 (UTC) Received: from msg.credativ.de (unknown [IPv6:2003:5b:203b:100:7627:eaff:fe52:8e03]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cbe) by mail.credativ.com (Postfix) with ESMTPSA id BAD6E2034D; Wed, 15 Jun 2022 09:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=credativ.de; s=email; t=1655284436; bh=0bSaK7IAq9Sn8IIJQqEsHB4Gg4bRoc7aCcxJgkaGJkg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rEX5tb7LEck9d6iVZZW/4pKzn4l3lDE9aKATwJpSJ7h7FUu7cWxIIlecbzievSsK4 +g25wOJ+ZLms1G3qjcXC0rBxzMExIToykzBmkxDkfY9Vinojzm4fOtRe0OtJI0/OLF byTa5TQaStdt4ZK6eoxpRTn7biVRd4AgCOTK5kZyYU7f7jb3w0cKr5KgaXMeY5n7rx 37ZHEqFkNO01ODuZ8W6yjH4mLkAyvbK3cAf27oE1n0HIJ9j2sI1KxL6MsEwr3uTDrc 9YNz1KdvnFnvuHyC+lZxDnwfSd9az9sjW99Y8jygCp1czwDlpnWIevKIlvSFr8fOgO d7j5P+bTKiwxQ== Date: Wed, 15 Jun 2022 11:13:56 +0200 From: Christoph Berg To: Michael Paquier Cc: Tom Lane , Kyotaro Horiguchi , robertmhaas@gmail.com, pgsql-bugs@lists.postgresql.org Subject: psql --on-error-stop (Re: BUG #17504: psql --single-transaction -vON_ERROR_STOP=1 still) commits after client-side error Message-ID: References: <2649417.1654875709@sss.pgh.pa.us> <2656555.1654877531@sss.pgh.pa.us> <20220613.160701.975499861789120736.horikyota.ntt@gmail.com> <3791929.1655131936@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: Michael Paquier > Well, done. One thing that I find a bit surprising in all that is the > lack of consistency in the handling of the return code of psql when > the last switch fails when not using ON_ERROR_STOP. TBH ON_ERROR_STOP itself feels very brittle to me. Besides the fact that `psql -vON_ERROR_STOP=1` looks very ugly, it's only one typo away from breaking silently. `psql -vSTOP_ON_ERROR=1` (or -vON_EROR_STOP=1) looks good as well, but doesn't work. There should be a proper command line switch for it like `psql --on-error-stop` since typoing that errors. (The short options -eEsSq are already taken, so I'd propose psql -Q.) Christoph -- Senior Consultant, Tel.: +49 2166 9901 187 credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209 Trompeterallee 108, 41189 Mönchengladbach Geschäftsführung: Dr. Michael Meskes, Geoff Richardson, Peter Lilley Unser Umgang mit personenbezogenen Daten unterliegt folgenden Bestimmungen: https://www.credativ.de/datenschutz