Re: Autocommit off - commits/rollbacks

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: tushar nehete <tpnehete(at)gmail(dot)com>, Jerry Sievers <gsievers19(at)comcast(dot)net>, "Vogt, Michael" <Michael(dot)Vogt(at)united-security-providers(dot)ch>
Subject: Re: Autocommit off - commits/rollbacks
Date: 2011-03-29 14:03:48
Message-ID: 201103290703.48991.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday, March 29, 2011 4:35:04 am tushar nehete wrote:
> Yes We can use exception for each statement to restrict the rollback.
> But how we can use SAVEPOINT and rollback to SAVEPOINT
> in the stored function or procedure in POSTGRES?
> We can only use the savepoints in transactions but not in stored functions.
>
> Regards,
> Tushar
>

See below for how to achieve the same effect using EXCEPTIONS in pl/pgsql:

http://www.postgresql.org/docs/9.0/interactive/plpgsql-control-
structures.html#PLPGSQL-ERROR-TRAPPING

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2011-03-29 14:06:32 Re: anonymous record as an in parameter
Previous Message Kalai R 2011-03-29 13:59:05 postgresql-9.0 service starting problem