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

From David G. Johnston
Subject Re: Surprising behaviour of \set AUTOCOMMIT ON
Date
Msg-id CAKFQuwbb1edcD6RYb=o1dNfNLqwdLDin09DPFB3xEtdUuqBx-Q@mail.gmail.com
Whole thread Raw
In response to Re: Surprising behaviour of \set AUTOCOMMIT ON  (Venkata Balaji N <nag1010@gmail.com>)
Responses Re: Surprising behaviour of \set AUTOCOMMIT ON  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, Aug 11, 2016 at 2:11 AM, Venkata Balaji N <nag1010@gmail.com> wrote:

​[...]
 committing all the previously open transactions 
​[...]

"All"?  ​There can only ever be at most one open transaction at any given time...

I don't have a fundamental issue with saying "when turning auto-commit on you are also requesting that the open transaction, if there is one, is committed immediately."  I'm more inclined to think an error is the correct solution - or to respond in a way conditional to the present usage (interactive vs. script).  I disagree with  Robert's unsubstantiated belief regarding ON_ERROR_STOP and think that it captures the relevant user-intent for this behavior as well.

David J.

pgsql-hackers by date:

Previous
From: Stas Kelvich
Date:
Subject: Re: Logical Replication WIP
Next
From: Vladimir Sitnikov
Date:
Subject: Re: Slowness of extended protocol