pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgmasters.net>
To: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Statement-level rollback
Date: Fri, 3 Mar 2017 11:54:06 -0500
Message-ID: <dd643238-3a63-6596-034c-8842072a1b12@pgmasters.net> (raw)
In-Reply-To: <0A3221C70F24FB45833433255569204D1F6AAFFE@G01JPEXMBYT05>
References: <0A3221C70F24FB45833433255569204D1F6A9286@G01JPEXMBYT05>
	<1915.1488287837@sss.pgh.pa.us>
	<3e224315-7043-e6da-a000-f2fc1a371e67@2ndquadrant.com>
	<1309.1488384319@sss.pgh.pa.us>
	<0A3221C70F24FB45833433255569204D1F6AAFFE@G01JPEXMBYT05>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 3/3/17 2:43 AM, Tsunakawa, Takayuki wrote:
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
>> 1. The argument for this is mostly, if not entirely, "application
>> compatibility".  But it won't succeed at providing that if every BEGIN has
>> to be spelled differently than it would be on other DBMSes.
>> Therefore there is going to be enormous pressure to allow enabling the
>> feature through a GUC, or some other environment-level way, and as soon
>> as we do that we've lost.
> 
> I thought so, too.  I believe people who want to migrate from other DBMSs would set the GUC in postgresql.conf, or with ALTER DATABASE/USER just for applications which are difficult to modify.
> 
>> 2. The proposed feature would affect the internal operation of PL functions,
>> so that those would need to become bulletproof against being invoked in
>> either operating environment.  Likewise, all sorts of intermediate tools
>> like connection poolers would no doubt be broken if they don't know about
>> this and support both modes.  (We would have to start by fixing postgres_fdw
>> and dblink, for instance.)
> 
> Yes, I'm going to modify the PL's behavior.  I'll also check the dblink and postgres_fdw as well.  In addition, I'll have a quick look at the code of pgpool-II and pgBouncer to see how they depend on the transaction state.  I'll run the regression tests of contribs, pgpool-II and pgBouncer with default_transaction_rollback_scope set to 'statement'.
> 
> But I don't see how badly the statement-level rollback affects those features other than PL.  I think the only relevant thing to those client-side programs is whether the transaction is still running, which is returned with ReadyForQuery.  Both of statement-level rollback and the traditional behavior leave the transaction running when an SQL statement fails.  Server-side autocommit differs in that respect.

Whatever the merits of this patch, it's a pretty major behavioral change
with a large potential impact.  Even if what is enumerated here is the
full list (which I doubt), it's pretty big.

Given that this landed on March 28 with no discussion beforehand, I
recommend that we immediately move this patch to the 2017-07 CF.

-- 
-David
david@pgmasters.net


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (52+ messages)  latest in thread

Message-ID: <dd643238-3a63-6596-034c-8842072a1b12@pgmasters.net>
Permalink:  ../dd643238-3a63-6596-034c-8842072a1b12@pgmasters.net/
Also on:    postgresql.org/message-id/dd643238-3a63-6596-034c-8842072a1b12@pgmasters.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: david@pgmasters.net, tsunakawa.takay@jp.fujitsu.com, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: Statement-level rollback
  In-Reply-To: <dd643238-3a63-6596-034c-8842072a1b12@pgmasters.net>
  References: <0A3221C70F24FB45833433255569204D1F6A9286@G01JPEXMBYT05> <1915.1488287837@sss.pgh.pa.us> <3e224315-7043-e6da-a000-f2fc1a371e67@2ndquadrant.com> <1309.1488384319@sss.pgh.pa.us> <0A3221C70F24FB45833433255569204D1F6AAFFE@G01JPEXMBYT05> <dd643238-3a63-6596-034c-8842072a1b12@pgmasters.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox