Re: Transaction within plpgsql - Mailing list pgsql-novice

From Bruce Momjian
Subject Re: Transaction within plpgsql
Date
Msg-id 200509302111.j8ULBuJ21438@candle.pha.pa.us
Whole thread Raw
In response to Transaction within plpgsql  ("Walker, Jed S" <Jed_Walker@cable.comcast.com>)
Responses Re: Transaction within plpgsql
List pgsql-novice
Walker, Jed S wrote:
> I am coding a procedure to purge data from a table. I want to commit the
> data I'm purging at intervals (for example, every 1000 rows). The
> problem I'm encountering is that when I have
>
> begin transaction;
> commit;
>
> statements in my plpgsql function it doesn't compile.
>
> How can you explicitly create transactions within a plpgsql function?

No, you can not, sorry, but you might as well just do the entire thing
in the single transaction of the function.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-novice by date:

Previous
From: "Walker, Jed S"
Date:
Subject: Transaction within plpgsql
Next
From: ig@freemail.gr (Çëßáò Ãêïõíôáñüðïõëïò)
Date:
Subject: Postgresql 8.0.3 installation problem on WinXP SP2