Re: Practical error logging for very large COPY

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Practical error logging for very large COPY
Дата
Msg-id 11335.1132671524@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Practical error logging for very large COPY  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: Practical error logging for very large COPY  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> I have committed the sin of omission again.

> Duplicate row violation is the big challenge, but not the only function
> planned. Formatting errors occur much more frequently, so yes we'd want
> to log all of that too. And yes, it would be done in the way you
> suggest.

> Here's a fuller, but still brief sketch:

> COPY ... FROM ....
>     [ERRORTABLES format1 [uniqueness1]
>      [ERRORLIMIT percent]]


This is getting worse, not better :-(

The general problem that needs to be solved is "trap any error that
occurs during attempted insertion of a COPY row, and instead of aborting
the copy, record the data and the error message someplace else".  Seen
in that light, implementing a special path for uniqueness violations is
pretty pointless.

You could almost do this today in about five minutes with a PG_TRY
construct.  The hard part is to distinguish errors that COPY can safely
trap from errors that must be allowed to abort the transaction anyway
(usually because the backend won't be in a consistent state if it's not
allowed to do post-abort cleanup).  I think the latter class would
mostly be "internal" errors, and so not trapping them shouldn't be a big
problem for usefulness; but we can't simply ignore the possibility that
they would occur during COPY.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: order by, for custom types
Следующее
От: Grzegorz Jaskiewicz
Дата:
Сообщение: Re: order by, for custom types