Re: Do Postgres exceptions rise up the stack? - Mailing list pgsql-general

From Wiebe Cazemier
Subject Re: Do Postgres exceptions rise up the stack?
Date
Msg-id f66jqe$dbj$1@sea.gmane.org
Whole thread Raw
In response to Do Postgres exceptions rise up the stack?  ("Postgres User" <postgres.developer@gmail.com>)
List pgsql-general
On Saturday 30 June 2007 23:52, Postgres User wrote:

> How about this scenario:
>
> func A()
>
> begin
>    x  =  func B();
>    y  =  func C();
>
>    z = func D();
>
> end
>
> Where func A, B, C, and D all update the db.  If a funciton is raised
> in func D(), will all the transactions in the other children be rolled
> back?
> Or do I need to add code to enable this?

(Noted correction in other reply).

It will be rolled back. When you don't begin a transaction explicitly,
postgresql creates one implicitely when you execute a function. So, calling a
function will always be atomic.

pgsql-general by date:

Previous
From: "Postgres User"
Date:
Subject: Re: Do Postgres exceptions rise up the stack?
Next
From: cluster
Date:
Subject: Bitmap index?