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 1madTn-0006vk-Gy for psycopg@arkaria.postgresql.org; Wed, 13 Oct 2021 12:35:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1madTm-0007xh-HL for psycopg@arkaria.postgresql.org; Wed, 13 Oct 2021 12:35:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1madFm-0007d9-5y for psycopg@lists.postgresql.org; Wed, 13 Oct 2021 12:21:02 +0000 Received: from mail.emypeople.net ([68.132.158.180]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1madFi-0008E2-Ku for psycopg@lists.postgresql.org; Wed, 13 Oct 2021 12:21:01 +0000 DKIM-Signature: a=rsa-sha256; t=1634127655; x=1634732455; s=mail; d=emypeople.net; c=relaxed/relaxed; v=1; bh=w8a+QtJGtjQ0ore+dw/4HG4Cra6WiIxnh2kotPjxOMQ=; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References; b=ykmYisTzo7PWVR+rg9Jd+ETdmSQF+12F1eDQ4nIYFzCRhRJguNM0MN+Pa0zJfq6HW4EHneeU3hIVaCMdUV5aaIPBkGqJpdD6fTMueKBkFQqMs4zVkr3NsS15v6L2/VSoeBqURP0LKq91rX2E1VszF9dsQVoDQLGlnAwTv1s/uJY= Received: from [192.168.0.102] ([174.244.113.197]) by mail.emypeople.net (13.0.1 build 4 RHEL7 x64) with ASMTP id 202110130820552375 for ; Wed, 13 Oct 2021 08:20:55 -0400 Subject: Re: psycopg3 transactions To: psycopg@lists.postgresql.org References: <9a99d2d110b121542d1ea0a05066858b@paolodestefani.it> From: Reuben Rissler Message-ID: Date: Wed, 13 Oct 2021 08:20:54 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > I think we can improve the documentation there by extending more about > the effects of the interaction between DBAPI transactions and the > transaction() blocks. And things are definitely more intuitive if > transaction() is used in autocommit: we might want to advise people to > do that. > > Suggestions are welcome. > > -- Daniele > I find this new behavior of psycopg(3) more sane, even if less ?intuitive?, than the behavior of psycopg2. I had run across the fact that you can close the cursor and then commit afterwards. I found this odd, as I would have guessed closing a cursor with uncomitted data would have thrown the data away. Disclaimer: I haven't actually used the new psycopg. I just actively follow this mail list while continuing to use psycopg2. Reuben Rissler