Re: Functions and transactions - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Functions and transactions
Date
Msg-id 20080408135357.GD31397@svana.org
Whole thread Raw
In response to Functions and transactions  (Giorgio Valoti <giorgio_v@mac.com>)
List pgsql-general
On Tue, Apr 08, 2008 at 03:44:47PM +0200, Giorgio Valoti wrote:
>     Hi all, the documentation says that functions are always executed
> within the transaction established by the outer query. However, I was
> quite surprised (in a positive way, that is) seeing that if a
> function call causes some error, the whole function is "rolled back".
> Is this the expected behavior?

Yes. Just like errors in queries cause the transaction to be rolled
back. Mind you, inside functions you can trap errors, but the default
is to rollback everything in the current transaction.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Attachment

pgsql-general by date:

Previous
From: Simone Brunozzi
Date:
Subject: Postgresql Conferences/events in Europe?
Next
From: "Mr.Frog.to.you@googlemail.com"
Date:
Subject: High Availability / Replication with Sequoia