Skip site navigation (1) Skip section navigation (2)

Re: Do Postgres exceptions rise up the stack?

From: Wiebe Cazemier <halfgaar(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Do Postgres exceptions rise up the stack?
Date: 2007-06-30 22:00:46
Message-ID: f66jqe$dbj$1@sea.gmane.org (view raw or flat)
Thread:
Lists: 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.


In response to

pgsql-general by date

Next:From: clusterDate: 2007-06-30 23:23:57
Subject: Bitmap index?
Previous:From: Postgres UserDate: 2007-06-30 21:53:13
Subject: Re: Do Postgres exceptions rise up the stack?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group