Re: transactions in plpgsql - Mailing list pgsql-general

From Gregory Wood
Subject Re: transactions in plpgsql
Date
Msg-id 405C9D26.5070207@ewebengine.com
Whole thread Raw
In response to Re: transactions in plpgsql  (Martin Marques <martin@bugs.unl.edu.ar>)
List pgsql-general
> El Vie 19 Mar 2004 12:49, Richard Huxton escribió:
>
>>On Friday 19 March 2004 13:01, Martin Marques wrote:
>>
>>>I'm building some functions in plpgsql, and I got to a point where I
>>>thought: How are transactions used in the function? Is it posible to
>>>rollback the modifications that were made to the tables at some point in
>>>the plpgsql function?
>>
>>You can abort the entire transaction by raising an exception. Nothing more
>>sophisticated is available at the moment.
>
> OK, this would mean that the whole function is in a transaction. But what if I
> call another function from within this one and it that function gets an error
> which is RAISED? Can I do something about it on the original function, or do
> I have to let it all rollback?

Until nested transactions are in place (7.5 maybe?), it all has to rollback.

Greg

pgsql-general by date:

Previous
From: Gregory Wood
Date:
Subject: Re: Triggers After INSERT
Next
From: David Garamond
Date:
Subject: Re: Index selection (and partial index) for BYTEA field