Re: ERROR : invalid transaction termination : PostgreSQL v12

Поиск
Список
Период
Сортировка
От Holger Jakobs
Тема Re: ERROR : invalid transaction termination : PostgreSQL v12
Дата
Msg-id 783165ad-62f6-dad9-6aa9-814428e49743@jakobs.com
обсуждение исходный текст
Ответ на Re: ERROR : invalid transaction termination : PostgreSQL v12  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: ERROR : invalid transaction termination : PostgreSQL v12
Список pgsql-admin

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> 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
Вложения

В списке pgsql-admin по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Streaming Replication replay lag
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ERROR : invalid transaction termination : PostgreSQL v12