Re: psycopg3 transactions

From: Paolo De Stefani <paolo(at)paolodestefani(dot)it>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: Psycopg <psycopg(at)postgresql(dot)org>
Subject: Re: psycopg3 transactions
Date: 2021-10-13 13:20:54
Message-ID: 6683df3e65fe961aa478e61db7ad687d@paolodestefani.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Il 13/10/2021 13:50 Daniele Varrazzo ha scritto:
>
> 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 think the problem is only for people like me that come from psycopg2.

I was used to wrote a "with con.cursor() as cur:" that now i hato to
replace with:

with con.transaction():
with con.cursor() as cur:
cur.execute("ANY SQL STATEMENT")

and everything works as expected (or i expect...)

Thanks for clarifying

--
Paolo De Stefani

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2021-10-13 13:46:46 Re: psycopg3 transactions
Previous Message Lembark, Steven 2021-10-13 13:11:14 Using standard SQL placeholders in PG