Re: Surprising behaviour of \set AUTOCOMMIT ON - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Surprising behaviour of \set AUTOCOMMIT ON
Date
Msg-id CAA4eK1LO25NyowfpC6EYmA7nCDR+Lbo5g1u5wHpJp3bOguJF7A@mail.gmail.com
Whole thread Raw
In response to Re: Surprising behaviour of \set AUTOCOMMIT ON  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Surprising behaviour of \set AUTOCOMMIT ON  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Wed, Aug 3, 2016 at 5:09 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
>
> 2016-08-03 12:16 GMT+02:00 Rahila Syed <rahilasyed90@gmail.com>:
>>
>> Should changing the value from OFF to ON automatically either commit or
>> rollback transaction in progress?
>>
>>
>> FWIW, running  set autocommit through ecpg commits the ongoing transaction
>> when autocommit is set to ON from OFF. Should such behaviour be implemented
>> for \set AUTOCOMMIT ON as well?
>
>
> I dislike automatic commit or rollback here.
>

What problem you see with it, if we do so and may be mention the same
in docs as well.  Anyway, I think we should make the behaviour of both
ecpg and psql same.

> What about raising warning if
> some transaction is open?
>

Not sure what benefit we will get by raising warning.  I think it is
better to choose one behaviour (automatic commit or leave the
transaction open as is currently being done in psql) and make it
consistent across all clients.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: max_parallel_degree > 0 for 9.6 beta
Next
From: Tom Lane
Date:
Subject: Re: handling unconvertible error messages