Re: how to rollback transactions in a function?

From: "PGMailList" <pgmail(at)pgexplorer(dot)com>
To: "V R" <varadha24(at)hotmail(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: how to rollback transactions in a function?
Date: 2002-05-03 11:16:10
Message-ID: 001701c1f293$edf2a120$05faa8c0@edios
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

To rollback the transaction
either call

if NOT (YourFunctionThatReturnsBool) then
ROLLBACK;

or
raise exception ''you error here'';

http://www.pgexplorer.com
PostgreSQL GUI

----- Original Message -----
From: V R
To: pgsql-novice(at)postgresql(dot)org
Sent: Tuesday, April 02, 2002 10:49 AM
Subject: [NOVICE] how to rollback transactions in a function?

Hi,
I have written a parent function, which inturn, calls 2-3 child functions that either insert or update rows in tables .The problem I face is when one of these child functions fail to update or insert and return False.So in this scenario how do I rolback the transactions made by the earlier child functions ? Any feedback regarding this will be helpful.

Thanks
Radha

------------------------------------------------------------------------------
Send and receive Hotmail on your mobile device: Click Here

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2002-05-03 14:18:00 Re:
Previous Message Duncan Adams (DNS) 2002-05-03 11:10:07 error on create rule.