Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Ravi Krishna <s_ravikrishna(at)aol(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
Date: 2022-10-18 20:16:29
Message-ID: 72BEC008-DC6C-4D80-80A6-E1634CFFA656@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Oct 18, 2022, at 13:14, Ravi Krishna <s_ravikrishna(at)aol(dot)com> wrote:
>
> I am getting error at COMMIT -> cannot commit while a subtransaction is active.
> Is commit not possible in a loop

You can commit in a loop, but not in BEGIN / END block that has an exception handler: that creates a subtransaction for the duration of the BEGIN / END.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bryn Llewellyn 2022-10-18 21:15:20 Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
Previous Message Ravi Krishna 2022-10-18 20:14:05 COMMIT IN STORED PROCEDURE WHILE IN A LOOP