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

From Matt Kelly
Subject Re: Surprising behaviour of \set AUTOCOMMIT ON
Date
Msg-id CA+KcUkhz=h_uYxWv_vtbSvwqGd7S3u3zVdYh+AqFra9bXja09w@mail.gmail.com
Whole thread Raw
In response to Re: Surprising behaviour of \set AUTOCOMMIT ON  (Brendan Jurd <direvus@gmail.com>)
Responses Re: Surprising behaviour of \set AUTOCOMMIT ON  (Rahila Syed <rahilasyed90@gmail.com>)
List pgsql-hackers
<div dir="ltr"><div class="gmail_extra">Its worth noting that the JDBC's behavior when you switch back to autocommit is
toimmediately commit the open transaction.</div><div class="gmail_extra"><br /></div><div
class="gmail_extra">Personally,I think committing immediately or erroring are unsurprising behaviors.  The current
behavioris surprising and obviously wrong.  Rolling back without an error would be very surprising (no other database
APII know of does that) and would take forever to debug issues around the behavior.  And committing after the next
statementis definitely the most surprising behavior suggested.</div><div class="gmail_extra"><br /></div><div
class="gmail_extra">IMHO,I think committing immediately and erroring are both valid.  I think I'd prefer the error in
principle,and per the law of bad code I'm sure, although no one has ever intended to use this behavior, there is
probablysome code out there that is relying on this behavior for "correctness".  I think a hard failure and making the
devadd an explicit commit is least likely to cause people serious issues.  As for the other options, consider me
opposed.</div><divclass="gmail_extra"><br /></div><div class="gmail_extra">- Matt K.</div></div> 

pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: Oddity with NOT IN
Next
From: Tom Lane
Date:
Subject: Draft release notes for next week's back-branch releases