Re: Surprising behaviour of \set AUTOCOMMIT ON

From: Venkata Balaji N <nag1010(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Rahila Syed <rahilasyed90(at)gmail(dot)com>, Matt Kelly <mkellycs(at)gmail(dot)com>, Brendan Jurd <direvus(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Surprising behaviour of \set AUTOCOMMIT ON
Date: 2016-08-11 06:11:16
Message-ID: CAEyp7J9Zr255QjoPTvOvGNeDzvkGjp3Nf+rf_G09yaPmA7r2Og@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 11, 2016 at 2:58 PM, Venkata Balaji N <nag1010(at)gmail(dot)com> wrote:

>
> On Tue, Aug 9, 2016 at 1:02 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
>> On Mon, Aug 8, 2016 at 10:10 AM, Rahila Syed <rahilasyed90(at)gmail(dot)com>
>> wrote:
>> > Thank you for inputs everyone.
>> >
>> > The opinions on this thread can be classified into following
>> > 1. Commit
>>
> This makes more sense as the user who is doing it would realise that the
> transaction has been left open.
>
>
>> Alternatively, I also think it would be sensible to issue an immediate
>> COMMIT when the autocommit setting is changed from off to on. That
>> was my first reaction.
>>
>
> Issuing commit would indicate that, open transactions will be committed
> which is not a good idea in my opinion. If the user is issuing AUTOCOMMIT =
> ON, then it means all the transactions initiated after issuing this must be
> committed, whereas it is committing the previously pending transactions as
> well.
>

My apologies for confusing statement, correction - i meant, by setting
autocommit=on, committing all the previously open transactions (
transactions opened when autocommit=off) may not be a good idea. What user
meant by autocommit=on is that all the subsequent transactions must be
committed.

Regards,
Venkata B N

Fujitsu Australia

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-08-11 06:14:45 Re: regression test for extended query protocol
Previous Message Michael Paquier 2016-08-11 05:55:32 Re: multivariate statistics (v19)