Re: Trouble with Savepoints in postgres - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Trouble with Savepoints in postgres
Date
Msg-id 20080312121113.GA4926@alvh.no-ip.org
Whole thread Raw
In response to Trouble with Savepoints in postgres  (sam <sam.mahindrakar@gmail.com>)
List pgsql-general
Please always ensure that the list is copied on replies (use "Reply to
all") so that other people can help you.

sam escribió:
> On Mar 11, 5:39 pm, alvhe...@commandprompt.com (Alvaro Herrera) wrote:
> > sam escribió:
> >
> > > Iam not able to understand if this is a version problem or the way iam
> > > using savepoints is wrong.Please advice.
> >
> > It is.  You cannot use savepoints in PL/pgSQL functions (or any function
> > for that matter).  You can use EXCEPTION clauses instead.

> Then u please tell me how save points can be  used...........The
> program iam working on is throwing an 'LIMIT EXCEEDED' error so iam
> trying to commit data so that a total rollback does not occur.Like
> commiting data after every 1000 transactions. I figured that
> savepoints would be the solution.

No, savepoints will not help you there.  No matter what you do, you
cannot commit in the middle of a function.

What's the limit being exceeded?  Perhaps you can solve your problem
some other way.


--
Alvaro Herrera                          Developer, http://www.PostgreSQL.org/
"Escucha y olvidarás; ve y recordarás; haz y entenderás" (Confucio)

pgsql-general by date:

Previous
From: "Kynn Jones"
Date:
Subject: Re: Trigger to run @ connection time?
Next
From: "Marcus Vinícius"
Date:
Subject: oralink