Re: how to use savepoint and rollback in function

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: tushar nehete <tpnehete(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to use savepoint and rollback in function
Date: 2011-03-16 07:46:37
Message-ID: D511E937-01A8-458A-9FBB-4838D9B24373@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 16 Mar 2011, at 6:25, tushar nehete wrote:

> Hi All,
> In Postgresql we can use savepoint and rollback to savepoint in transaction.
> But we cannot use savepoint in function.
> Currently I am doing migration from Informix to Postgresql 8.4.
> In Informix they used Savepoint.
> Please advice how to use Savepoint and rollback to savepoint in function.
> I know Postgresql has autocommit. But I want to rollback to a particular savepoint.

Within functions you can use exceptions with begin/end blocks to get the same behaviour as savepoints and rollbacks.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,4d806b00235886291739995!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message dhaval jaiswal 2011-03-16 08:14:40 Re: how to use savepoint and rollback in function
Previous Message Alban Hertroys 2011-03-16 07:40:52 Re: Partitioned Database and Choosing Subtables