Re: Information on savepoint requirement within transctions

From: Robert Zenz <robert(dot)zenz(at)sibvisions(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Information on savepoint requirement within transctions
Date: 2018-01-29 15:50:36
Message-ID: 5A6F42CB.2070907@sibvisions.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29.01.2018 16:33, Tom Lane wrote:
> That behavior does exist, and so does documentation for it; you're just
> looking in the wrong place.
>
> Years ago (7.3 era, around 2002) we experimented with a server-side
> GUC variable "AUTOCOMMIT", which switched from the implicit-commit-
> if-you-don't-say-BEGIN behavior to implicitly-issue-BEGIN-so-you-
> have-to-say-COMMIT-explicitly. That was an unmitigated disaster:
> flipping the setting broke just about all client applications. After
> spending many months trying to fix just the apps we ship with Postgres,
> and getting pushback from users whose code broke with the alternate
> setting, we gave up and removed the feature. Instead we set project
> policy that if you want to modify transactional behavior you have to
> do it on the client side, where it doesn't risk breaking other apps.
> Institutional memory around here is very long, so any time proposals to
> change the server or wire-protocol behavior in this area come up, they
> get batted down.
>
> What we do have though is client-side support for appropriate behaviors.
> In psql, see the AUTOCOMMIT and ON_ERROR_ROLLBACK control variables.
> Other interfaces such as JDBC have their own ideas about how this ought
> to work.

Very interesting. However, I'm talking explicitly about the behavior that occurs
when AUTOCOMMIT is switched off and a statement fails.

Most curiously, you already did such a feature (of what I was talking about)
request in 2007:
https://www.postgresql.org/message-id/flat/11539(dot)1177352713%40sss(dot)pgh(dot)pa(dot)us#11539(dot)1177352713(at)sss(dot)pgh(dot)pa(dot)us

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-01-29 16:00:20 Re: Information on savepoint requirement within transctions
Previous Message Matej 2018-01-29 15:49:19 Re: PG Sharding