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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Do Postgres exceptions rise up the stack?



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.




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group