Re: Commit every processed record

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: "luke(dot)78(at)libero(dot)it" <luke(dot)78(at)libero(dot)it>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Commit every processed record
Date: 2008-04-07 13:38:51
Message-ID: 47FA23EB.8060701@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

luke(dot)78(at)libero(dot)it wrote:
> Hi,
> I have to execute commit for evey record that i processed during a cursor fetch in a function.
> There is a way to do it?
>
>
Sure. Do it outside PL/PgSQL, using a database client API like those
available for Python, Java, Perl, etc.

If you really need to do it in PL/PgSQL, is there any reason you can't
do all the work in one transaction and commit when the function finishes?

--
Craig Ringer

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2008-04-07 14:03:33 Re: undefined relations in pg_locks
Previous Message Craig Ringer 2008-04-07 13:36:38 Re: Problem commit in function