pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: New parameter RollbackError to control rollback behavior on error
Date: Wed, 26 Mar 2014 10:53:52 +0200
Message-ID: <533295A0.4010405@vmware.com> (raw)
In-Reply-To: <CAB7nPqRrnMgMMW2maGOA3sOXtA12=Pogt4dpDzQR2fb8zffcmQ@mail.gmail.com>
References: <CAB7nPqRrnMgMMW2maGOA3sOXtA12=Pogt4dpDzQR2fb8zffcmQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 03/26/2014 08:39 AM, Michael Paquier wrote:
> Hi all,
>
> The behavior of rollback when an error occurs on an handle is
> controlled by extending Protocol with "$PROTNUM-[0|1|2]" where:
> - 0 = let the application handle rollbacks
> - 1 = rollback whole transaction when an error occurs
> - 2 = rollback only statement that failed
> Using such an extension is somewhat awkward as a single string is used
> for two settings... The proposed attached patch adds a new parameter
> called RollbackError that allows to control the behavior of rollback
> on error with a different parameter.

Great!

Since we're designing a new user interface for this, let's try to make 
it as user-friendly as possible:

* I'm not too fond of the RollbackError name. It sounds like "an error 
while rolling back". I googled around and found out that DataDirect's 
proprietary driver has the same option, and they call it 
TransactionErrorBehavior. See 
http://blogs.datadirect.com/2013/07/solution-unexpected-postgres-current-transaction-aborted-error.h....

* Instead of using 0-2 as the values, let's give them descriptive names. 
Something like "none", "RollbackTransaction", "RollbackStatement". 
(actually, we'll probably want to also allow the integers, to keep the 
connection string short, as there is a size limit on that)

> I thought first about including that in my cleanup work for 9.4, but
> as this actually does not break the driver it may be worth adding it
> directly to master, explaining the patch attached here. Comments
> welcome. Note that if there are objections I do not mind adding that
> for the work that would be merged later to 9.4 builds.

Yeah, let's get this into the master branch before your big 9.4 cleanup 
work.

- Heikki


-- 
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 (13+ messages)  latest in thread

Message-ID: <533295A0.4010405@vmware.com>
Permalink:  ../533295A0.4010405@vmware.com/
Also on:    postgresql.org/message-id/533295A0.4010405@vmware.com

 · 

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-odbc@postgresql.org
  Cc: hlinnakangas@vmware.com, michael.paquier@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: New parameter RollbackError to control rollback behavior on error
  In-Reply-To: <533295A0.4010405@vmware.com>
  References: <CAB7nPqRrnMgMMW2maGOA3sOXtA12=Pogt4dpDzQR2fb8zffcmQ@mail.gmail.com> <533295A0.4010405@vmware.com>

* 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