Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i6agN-0006q8-Rj for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Sep 2019 13:23:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i6agL-0002tu-U9 for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Sep 2019 13:23:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i6agL-0002mN-GX for pgsql-hackers@lists.postgresql.org; Sat, 07 Sep 2019 13:23:13 +0000 Received: from courriel.mines-paristech.fr ([77.158.173.149] helo=antispam-1.ensmp.fr) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i6agI-0000FT-9D for pgsql-hackers@lists.postgresql.org; Sat, 07 Sep 2019 13:23:11 +0000 Received: from smtp-5.mines-paristech.fr (smtp.mines-paristech.fr [77.158.173.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by antispam-1.ensmp.fr (antispam.mines-paristech.fr) with ESMTPS id 1C77555EF3; Sat, 7 Sep 2019 15:23:07 +0200 (CEST) Received: from lancre (251.237.219.88.rev.sfr.net [88.219.237.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-5.mines-paristech.fr (Postfix) with ESMTPSA id AFD9C2021F; Sat, 7 Sep 2019 15:23:06 +0200 (CEST) Date: Sat, 7 Sep 2019 15:23:05 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@lancre To: fn ln cc: Michael Paquier , Andres Freund , Peter Eisentraut , PostgreSQL Developers Subject: Re: BUG #15977: Inconsistent behavior in chained transactions In-Reply-To: Message-ID: References: <8655dc29-8d50-162d-deaf-fa0329dfed51@2ndquadrant.com> <20190904075305.2gkf5z4r6xwgxcwf@alap3.anarazel.de> <20190905211135.q63scps3pvrc3i43@alap3.anarazel.de> <20190906075415.GA31979@paquier.xyz> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudekuddgieefucetufdoteggodetrfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvufgjkfhffgggtgesthdtredttdervdenucfhrhhomhephfgrsghivghnucevqffgnffjqfcuoegtohgvlhhhohestghrihdrvghnshhmphdrfhhrqeenucfkphepkeekrddvudelrddvfeejrddvhedunecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > I made another patch for that. > I don't have much confidence with my English spelling so further > improvements may be needed. > >> If it is too much a change and potential regression, then I think that the >> "and chain" variants should be consistent and just raise warnings. > We don't have an exact answer for implicit transaction chaining behavior > yet. > So I think it's better to disable this feature until someone discovers the > use cases for this. > Permitting AND CHAIN without a detailed specification might cause troubles > in future. I think that it would be too bad to remove this feature for a small implementation-dependent corner case. Documentation says that COMMIT/ROLLBACK [AND CHAIN] apply to the "current transaction", and "BEGIN initiates a transaction block". If there is no BEGIN, there is no "current transaction", so basically the behavior is unspecified, whether AND CHAIN or not, and we are free somehow. In such case, I'm simply arguing for consistency: whatever the behavior, the chain and no chain variants should behave the same. Now, I'd prefer error in all cases, no doubt about that, which might be considered a regression. A way around that could be to have a GUC decide between a strict behavior (error) and the old behavior (warning). -- Fabien.