Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP - Mailing list pgsql-general

From Tom Lane
Subject Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
Date
Msg-id 2746245.1666128817@sss.pgh.pa.us
Whole thread Raw
In response to Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP  (Bryn Llewellyn <bryn@yugabyte.com>)
Responses Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
List pgsql-general
Bryn Llewellyn <bryn@yugabyte.com> writes:
> xof@thebuild.com wrote:
>> You can commit in a loop, but not in BEGIN / END block that has an exception handler: that creates a subtransaction
forthe duration of the BEGIN / END. 

> This surprised me when I first started to use PG (after all those years
> with ORCL).

Really?  BEGIN with an exception block is a subtransaction because it's
defined to roll back to the database state as of the start of the block
if an exception occurs.  COMMIT in the middle fundamentally conflicts
with that, I should think.  Does Oracle interpret that differently?

            regards, tom lane



pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
Next
From: Christophe Pettus
Date:
Subject: Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP