Re: How to insert in a table the error returns by query - Mailing list pgsql-sql

From Marc Mamin
Subject Re: How to insert in a table the error returns by query
Date
Msg-id B6F6FD62F2624C4C9916AC0175D56D8828B588BB@jenmbs01.ad.intershop.net
Whole thread Raw
In response to Re: How to insert in a table the error returns by query  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-sql
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br /> >On Wed, Jan 28, 2015 at
11:53AM, Marc Mamin-2 [via PostgreSQL] <[hidden email]> wrote:<br /> ><br /> ><br /> >    >In this
casewhen an error occurs the rollback work only on the wrong query. The other insert are committed.<br /> ><br />
><br/> >    The rollback only takes place on the errored statement, because you are catching the exception.<br />
>   In order to ensure a complete rollback of your transaction (which may have started outside of your function),<br
/>>    you'll need to rethrow an error after your exception handling.<br /> ><br /> ><br /> > The 9.4
documentationis in direct conflict with this statement...all persistent updates inside the associated BEGIN/END block
shouldbe rolled back.<br /><br /> You are right, and a quick test with 9.3.5 is consistent with the doc.<br />
regards,<br/><br /> Marc Mamin<br /><br /> ><br /> >Transactions MUST start "outside your function" by
definition. By not re-throwing the exception any outer block (i.e., the one calling the function) would still end up
intactbut every statement inside of the function should rollback unless separate blocks are created to isolate the
differentstatements.<br /> ><br /> >David J.</div> 

pgsql-sql by date:

Previous
From: David G Johnston
Date:
Subject: Re: How to insert in a table the error returns by query
Next
From: Nii Gii
Date:
Subject: Implementing incremental client updates