From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: ERROR : invalid transaction termination : PostgreSQL v12
Date: Tue, 24 Nov 2020 22:15:15 +0100
Message-ID: <783165ad-62f6-dad9-6aa9-814428e49743@jakobs.com> (raw)
In-Reply-To: <CAKFQuwZDfW2THiNe0Y95YLKGugH8h_7T1KOfCr7E7w3B1BPJZA@mail.gmail.com>
References: <CA+cYFttwzFJJyVYkW3Ld9r=SUTgViwMwCFtV+SQJamzghXkTcA@mail.gmail.com>
<7685663c-4fb4-2875-9164-a44007ca9568@jakobs.com>
<CAKFQuwZDfW2THiNe0Y95YLKGugH8h_7T1KOfCr7E7w3B1BPJZA@mail.gmail.com>
So what is the intended behaviour?
* If you run everything in autocommit, it will be very slow, but all
non-failing records will end up in the table alright.
* If you run a commit after a couple of records, you will lose all
records of this group if there is at least one failing record.
is that what you want?
Oracle's behaviour of saving all non-failing records while discarding
all failing records is not directly possible with PostgreSQL, because
the sense of a transaction is all-or-nothing.
Am 24.11.20 um 16:39 schrieb David G. Johnston:
> On Tue, Nov 24, 2020 at 12:57 AM Holger Jakobs <holger@jakobs.com
> <mailto:holger@jakobs.com>> wrote:
>
> What is the point of COMMITting after a few records? Why not let
> the whole batch run through. If there are any errors, PostgreSQL
> will rollback the whole transaction anyway.
>
> Avoiding that behavior is the point of batching with periodic commits.
>
> David J.
>
--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
Attachments:
OpenPGP_signature (application/pgp-signature, 202B) download
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
Subject: Re: ERROR : invalid transaction termination : PostgreSQL v12
In-Reply-To: <783165ad-62f6-dad9-6aa9-814428e49743@jakobs.com>
* 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