Re: psycopg3 transactions

2021-10-21 Thread Daniele Varrazzo
On Sat, 16 Oct 2021, 23:48 Karsten Hilbert, wrote: > > I am sorry to say this but this concept: > > This way we don’t have to remember to call neither > close() nor commit() and the database operation have > actually a persistent effect. > > seems fundamentally flawed to m

Aw: Re: psycopg3 transactions

2021-10-21 Thread Karsten Hilbert
> The behaviour of a dbapi connection, without context block, is to just close > the communication. The fact that this results in a rollback > stems only from > the behaviour of the server But that's the whole point? A driver should _not_ (by default) alter the default behaviour of the other

Re: Re: psycopg3 transactions

2021-10-21 Thread Daniele Varrazzo
On Thu, 21 Oct 2021 at 12:06, Karsten Hilbert wrote: > > > The behaviour of a dbapi connection, without context block, is to just > > close the communication. The fact that this results in a rollback > stems > > only from the behaviour of the server > > But that's the whole point? A driver sho

Re: Re: psycopg3 transactions

2021-10-21 Thread Magnus Hagander
On Thu, Oct 21, 2021 at 2:00 PM Daniele Varrazzo wrote: > On Thu, 21 Oct 2021 at 12:06, Karsten Hilbert > wrote: > > > > > The behaviour of a dbapi connection, without context block, is to just > close the communication. The fact that this results in a rollback > stems > only from the behaviour

Re: psycopg3 transactions

2021-10-21 Thread Christophe Pettus
> 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.