Re: existence of a savepoint? - Mailing list pgsql-general

From David G. Johnston
Subject Re: existence of a savepoint?
Date
Msg-id CAKFQuwa47-HWHTL898fbUC2pGDi2bm7qfCCRA4M9txy-L1nfwA@mail.gmail.com
Whole thread Raw
In response to Re: existence of a savepoint?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: existence of a savepoint?
List pgsql-general
On Tue, May 29, 2018 at 4:01 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
On 2018-May-29, Stuart McGraw wrote:

> Alternatively if there were a setting to tell Postgresql to
> follow the SQL standard behavior of overwriting rather stacking
> savepoints, that too would also solve my current problem I think.
> Perhaps it is just my limited experience but the former behavior
> has always seemed more useful in practice than the latter.

I think if what we're doing breaks the semantics of the SQL spec, we're
definitely open to changing our behavior.  But that wouldn't solve your
problem today.  What I think could solve your problem today is a
C-language extension that uses xact.c callbacks in order to expose a
list that you can query from user space.
 
​Stuart:​

That said, have you measured this "leaking" and can show that it is non-trivial (given the large size of the overall transaction)?

Beyond that bulk ETL leveraging SAVEPOINT is not something I've encountered or contemplated.  Expecting and reacting to errors is expensive and itself error-prone.  I'd much rather try to design something that where failure is simply bad - usually by bulk loading with fewer constraints and then ensuring that future queries don't attempt to do something illegal like insert duplicates.

David J.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
Next
From: tango ward
Date:
Subject: reduce number of multiple values to be inserted