From: Ravi Krishna <s_ravikrishna@aol.com>
To: xof@thebuild.com
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
Date: Tue, 18 Oct 2022 17:29:11 -0400
Message-ID: <VOMN1IM86IU4.HNL8WUVWUAMM3@ravi-surface> (raw)
In-Reply-To: <72BEC008-DC6C-4D80-80A6-E1634CFFA656@thebuild.com>
References: <353091661.109766.1666124045054.ref@mail.yahoo.com>
<353091661.109766.1666124045054@mail.yahoo.com>
<72BEC008-DC6C-4D80-80A6-E1634CFFA656@thebuild.com>
> 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.
The reason I have to deal with error exception is that I want to ignore failure on a table and move on to next table.
I thought I can trick it by moving the part of the code which executes dynamic sql and has exception handler in it,to a separate procedure. This way I can keep the main procedure without exception handler. It failed too withthe same error. So that means this restriction is not at lexical level, but at execution level.This is so disappointing. It seems there is no way I can copy each table and commit it individually and also capture error.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: s_ravikrishna@aol.com, xof@thebuild.com
Subject: Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
In-Reply-To: <VOMN1IM86IU4.HNL8WUVWUAMM3@ravi-surface>
References: <353091661.109766.1666124045054.ref@mail.yahoo.com> <353091661.109766.1666124045054@mail.yahoo.com> <72BEC008-DC6C-4D80-80A6-E1634CFFA656@thebuild.com> <VOMN1IM86IU4.HNL8WUVWUAMM3@ravi-surface>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox