From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: andyterry <andrew.terry@centremaps.co.uk>
Cc: pgsql-general@postgresql.org
Subject: Re: commit within a procedure loop - cannot commite with subtransaction
Date: Mon, 21 Jan 2019 16:03:32 +0000
Message-ID: <87bm4a3sqk.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <1548074591211-0.post@n3.nabble.com>
References: <1548074591211-0.post@n3.nabble.com>
>>>>> "andyterry" == andyterry <andrew.terry@centremaps.co.uk> writes:
andyterry> Hi,
andyterry> Using a procedure for the first time to run some processing
andyterry> for each row in a table, generating output to a target
andyterry> table. The following works without COMMIT the example below
andyterry> gives:
andyterry> INFO: Error Name:cannot commit while a subtransaction is active
andyterry> INFO: Error State:2D000
What client are you using to execute this? Some clients may insert
SAVEPOINT statements (which create subtransactions) behind your back
(e.g. psql with \set ON_ERROR_ROLLBACK does this) in order to recover
from errors without aborting the whole transaction.
(turn on log_statement=all in your config, or for the user you're
executing this as, and look for the command in the server log)
--
Andrew (irc:RhodiumToad)
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: andrew@tao11.riddles.org.uk, andrew.terry@centremaps.co.uk
Subject: Re: commit within a procedure loop - cannot commite with subtransaction
In-Reply-To: <87bm4a3sqk.fsf@news-spur.riddles.org.uk>
References: <1548074591211-0.post@n3.nabble.com> <87bm4a3sqk.fsf@news-spur.riddles.org.uk>
* 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