Re: transaction in plpgsql - Mailing list pgsql-sql

From Josh Berkus
Subject Re: transaction in plpgsql
Date
Msg-id web-1560422@davinci.ethosmedia.com
Whole thread Raw
In response to transaction in plpgsql  (Joseph Syjuco <joseph@asti.dost.gov.ph>)
List pgsql-sql
Joseph,

> so does that mean that if i call function 2 from function 1 and
> function
> 2 fails than function 1 and function 2 rolls back
> 
> hopefully the answer is yes

That's correct.  To diagram:

Function 1 calls|
V
Function 2 calls|
V
Function 3, which fails|
V
Function 3 is rolled back|
V
Function 2 is rolled back|
V
Function 1 is rolled back


While this automatic tranactioning and "All succeed or fail together"
functionality is sometimes useful, its often also a major annoyance.   Changing it is on the "todo" list, but poses
somemajor technical
 
challenges.

-Josh Berkus




pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: graphical interface - admin
Next
From: Robert Treat
Date:
Subject: Re: graphical interface - admin