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 1mdbKx-0002Xv-Nq for psycopg@arkaria.postgresql.org; Thu, 21 Oct 2021 16:54:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mdbKw-0001cd-NH for psycopg@arkaria.postgresql.org; Thu, 21 Oct 2021 16:54:38 +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 1mdbKw-0001cS-H6 for psycopg@lists.postgresql.org; Thu, 21 Oct 2021 16:54:38 +0000 Received: from smtp73.ord1c.emailsrvr.com ([108.166.43.73]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdbKu-0006La-53 for psycopg@postgresql.org; Thu, 21 Oct 2021 16:54:38 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp10.relay.ord1c.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id CA609402DB; Thu, 21 Oct 2021 12:54:33 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: psycopg3 transactions From: Christophe Pettus In-Reply-To: Date: Thu, 21 Oct 2021 09:22:07 -0700 Cc: Karsten Hilbert , Paolo De Stefani , Magnus Hagander , Daniele Varrazzo X-Mailbutler-Message-Id: A331ADC8-71AA-4E2A-9FE7-FCB2C1561B78 Content-Transfer-Encoding: quoted-printable Message-Id: <1A345ABA-0509-46DF-900C-BA0296ADD5A9@thebuild.com> References: <9a99d2d110b121542d1ea0a05066858b@paolodestefani.it> <6683df3e65fe961aa478e61db7ad687d@paolodestefani.it> To: Psycopg X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Classification-ID: 739bd78e-5c4d-4081-90c1-8861d4530684-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Oct 21, 2021, at 09:18, Magnus Hagander = wrote: > But yes, the biggest issue I have with it is the part that's outlined = in the Warning section of the docs there -- using it in different ways = provides completely and fundamentally different behaviour in a way that = can cause bad data. >=20 > Things would be a lot more clear if the *connection* context didn't do = *anything* with transactions whatsoever, and the *transaction* one did = all of it. When it comes to transactions, explicit is always better than = implicit IMNSHO. +1. I have to say that had I not read the warning, the behavior would = have taken me by surprise, even with a lot of psycopg2 experience.=