Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egBr9-0006Yz-15 for pgsql-general@arkaria.postgresql.org; Mon, 29 Jan 2018 16:00:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egBr7-0007l9-Sc for pgsql-general@arkaria.postgresql.org; Mon, 29 Jan 2018 16:00:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1egBr7-0007kz-Hg for pgsql-general@lists.postgresql.org; Mon, 29 Jan 2018 16:00:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egBr3-0002Q1-TZ for pgsql-general@postgresql.org; Mon, 29 Jan 2018 16:00:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w0TG0K4D002871; Mon, 29 Jan 2018 11:00:20 -0500 From: Tom Lane To: "David G. Johnston" cc: Robert Zenz , "pgsql-general@postgresql.org" Subject: Re: Information on savepoint requirement within transctions In-reply-to: References: <5A6B3F78.6030908@sibvisions.com> <5A6B4A12.9000002@sibvisions.com> <5A6EDD41.70005@sibvisions.com> <5A6F28A7.5080800@sibvisions.com> <5A6F3875.80607@sibvisions.com> <1644.1517239990@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Mon, 29 Jan 2018 08:46:06 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2869.1517241620.1@sss.pgh.pa.us> Date: Mon, 29 Jan 2018 11:00:20 -0500 Message-ID: <2870.1517241620@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Mon, Jan 29, 2018 at 8:33 AM, Tom Lane wrote: >> What we do have though is client-side support for appropriate behaviors. >> In psql, see the AUTOCOMMIT and ON_ERROR_ROLLBACK control variables. > Not quite the same. I think what people probably want is for psql to > recognize it is in a transaction and before sending a command to the server > for processing to precede it by sending "SAVEPOINT random()". Then, before > returning the result of the command to the user issue either "RELEASE > SAVEPOINT" or "ROLLBACK TO SAVEPOINT" depending on whether the command > succeeded or failed. Then report the result to the user. Which part of that isn't implemented by ON_ERROR_ROLLBACK? regards, tom lane