Re: commit within function

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Anj Adu <fotographs(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: commit within function
Date: 2009-07-16 02:35:57
Message-ID: dcc563d10907151935x30a8eb8uf5a39a3c5525c8e0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Oh wait, not both things. I'm saying to use error trapping first to
accomplish this. OR if that doesn't work, then look at savepoints.

On Wed, Jul 15, 2009 at 7:36 PM, Anj Adu<fotographs(at)gmail(dot)com> wrote:
> So..are you implying that we fake an error to force the commit on a
> savepoint..and just ignore the error and move on..if that works..i guess it
> will work for me.
>
> On Wed, Jul 15, 2009 at 5:49 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
> wrote:
>>
>> So, did this not work either?
>>
>>
>> http://www.postgresql.org/docs/8.4/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
>>
>> I had just figured that that hadn't worked, so you were looking for
>> something else.
>>
>> On Wed, Jul 15, 2009 at 4:32 PM, Anj Adu<fotographs(at)gmail(dot)com> wrote:
>> > No
>> >
>> > Savepoints allow a transaction to be committed upto a savepoint "if"
>> > somthing bad happens after savepoint..but I want an explicit commit even
>> > if
>> > nothing bad happens later..i.e.I need to commit "when" I want to. (just
>> > like
>> > Oracle PLSQL)
>> >
>> > On Wed, Jul 15, 2009 at 3:01 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
>> > wrote:
>> >>
>> >> On Wed, Jul 15, 2009 at 3:58 PM, Anj Adu<fotographs(at)gmail(dot)com> wrote:
>> >> > Is there a way to issue a commit within a function and continue
>> >> > processing?
>> >> > I know this is not possible in 8.1..
>> >> >
>> >> > We have long running function calls...parts of which are independent
>> >> > of
>> >> > each
>> >> > other. The independent functions are called within a "main" outer
>> >> > function.
>> >> > We would like to commit the data modified by each function as a
>> >> > single
>> >> > unit
>> >> > so that the data is freed up for other modules to act on.
>> >> >
>> >> > Are there any future postgres releases (we use 8.1.9) that possible
>> >> > address
>> >> > this.
>> >>
>> >> What you are looking for are savepoints, most likely.
>> >
>> >
>>
>>
>>
>> --
>> When fascism comes to America, it will be intolerance sold as diversity.
>
>

--
When fascism comes to America, it will be intolerance sold as diversity.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Abraham, Danny 2009-07-16 03:08:34 initdb --encoding=LATIN1 fails on Windows
Previous Message Scott Marlowe 2009-07-16 02:34:11 Re: commit within function