Re: [PL/pgSQL] Commit every N rows. Is it possible ?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Jeremiasz Miedzinski <jmiedzinski(at)gmail(dot)com>
Cc: PostgreSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: [PL/pgSQL] Commit every N rows. Is it possible ?
Date: 2006-11-09 14:58:21
Message-ID: 4553420D.8020405@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeremiasz Miedzinski wrote:
> I'm digging into postgresql documentation but maybe I'm just not smart
> enough to understand the way which transactions are being processed into
> pgSQL. Is it possible to port above code to PL/pgSQL ?

All functions, including pl/pgsql functions take place within a
transaction. You cannot commit, but you can catch errors and roll back
to savepoints within a transaction.

If you want to have multiple transactions you will need to step outside
of the database.

It's not clear to me why your function does what it does anyway. I can't
see why you wouldn't just do this as standard queries.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2006-11-09 15:01:41 Re: cannot connect anymore from a remote host
Previous Message Jeremiasz Miedzinski 2006-11-09 14:57:06 Re: cannot connect anymore from a remote host