Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSjb5-0004Mz-Va for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Mar 2014 08:54:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WSjb5-0007dG-FB for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Mar 2014 08:54:07 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSjb3-0007d7-V2 for pgsql-hackers@postgresql.org; Wed, 26 Mar 2014 08:54:06 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSjaw-0002xD-7G for pgsql-hackers@postgresql.org; Wed, 26 Mar 2014 08:54:02 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 358DB283BD; Wed, 26 Mar 2014 01:53:56 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 27B4718461; Wed, 26 Mar 2014 01:53:56 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 35C0012000A; Wed, 26 Mar 2014 01:53:51 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Wed, 26 Mar 2014 01:53:49 -0700 (PDT) Message-ID: <533295A0.4010405@vmware.com> Date: Wed, 26 Mar 2014 10:53:52 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Michael Paquier CC: PostgreSQL mailing lists Subject: Re: New parameter RollbackError to control rollback behavior on error References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.3 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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.html. * 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