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 1i1oYa-0005qV-Rf for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Aug 2019 09:11:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i1oYZ-0001Pn-Gt for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Aug 2019 09:11:27 +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 1i1oYZ-0001NZ-5e; Sun, 25 Aug 2019 09:11:27 +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 1i1oYR-0003hn-RV; Sun, 25 Aug 2019 09:11:25 +0000 Received: from smtp-4.mines-paristech.fr (smtp-4.ensmp.fr [77.158.173.143]) (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 59FAD55E14; Sun, 25 Aug 2019 11:11:16 +0200 (CEST) Received: from pc114.home (abordeaux-651-1-53-140.w109-223.abo.wanadoo.fr [109.223.236.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-4.mines-paristech.fr (Postfix) with ESMTPSA id 2095A2C01C8; Sun, 25 Aug 2019 11:11:16 +0200 (CEST) Date: Sun, 25 Aug 2019 11:11:09 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@lancre To: emuser20140816@gmail.com, PostgreSQL Bugs , PostgreSQL Developers Subject: Re: BUG #15977: Inconsistent behavior in chained transactions In-Reply-To: <15977-f4eb49ebdcacc65b@postgresql.org> Message-ID: References: <15977-f4eb49ebdcacc65b@postgresql.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1143678714-1566724276=:9896" X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudehvddgudegucetufdoteggodetrfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvufgjkfhffgggtgesmhdtreertderjeenucfhrhhomhephfgrsghivghnucevqffgnffjqfcuoegtohgvlhhhohestghrihdrvghnshhmphdrfhhrqeenucfkphepuddtledrvddvfedrvdefiedrudegtdenucfrrghrrghmpehmohguvgepshhmthhpohhuth X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1143678714-1566724276=:9896 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT > The following bug has been logged on the website: > > Bug reference: 15977 > Logged by: mtlh kdvt > Email address: emuser20140816@gmail.com > PostgreSQL version: 12beta3 > Operating system: Windows > Description: > > When a ROLLBACK AND CHAIN command is executed in the implicit transaction > block, a new transaction will be started: > db=# ROLLBACK AND CHAIN; > WARNING: there is no transaction in progress > ROLLBACK > db=# ROLLBACK AND CHAIN; > ROLLBACK > > However, a COMMIT AND CHAIN command won't start a new transaction: > db=# COMMIT AND CHAIN; > WARNING: there is no transaction in progress > COMMIT > db=# COMMIT AND CHAIN; > WARNING: there is no transaction in progress > COMMIT Thanks for the report. Indeed, I confirm, and I should have caught this one while reviewing… Doc says: "If AND CHAIN is specified, a new transaction is immediately started with the same transaction characteristics as the just finished one. Otherwise, no new transaction is started." If there is no transaction in progress, the spec is undefined. Logically, ITSM that there should be no tx reset if none was in progress, so ROLLBACK has the wrong behavior? A quick glance at the code did not yield any obvious culprit, but maybe I'm not looking at the right piece of code. Doc could happend ", if any" to be clearer. -- Fabien. --8323329-1143678714-1566724276=:9896--