Re: Conflict handling for COPY FROM

Поиск
Список
Период
Сортировка
От Surafel Temesgen
Тема Re: Conflict handling for COPY FROM
Дата
Msg-id CALAY4q9GtfScUoafzin8zFQ-UjXB65hByFy1jsS=VNbX9dvuXw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Conflict handling for COPY FROM  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Список pgsql-hackers


On Mon, Feb 17, 2020 at 10:00 AM Tatsuo Ishii <ishii@sraoss.co.jp> wrote:
>> test=# copy t1 from '/tmp/a' with (error_limit 1);
>> ERROR:  duplicate key value violates unique constraint "t1_pkey"
>> DETAIL:  Key (i)=(2) already exists.
>> CONTEXT:  COPY t1, line 2: "2   2"
>>
>> So if the number of errors raised exceeds error_limit, no constaraint
>> violating rows (in this case i=1, j=1) are returned.
>>
>
> error_limit is specified to dictate the number of error allowed in copy
> operation
> to precede. If it exceed the number the operation is stopped. there may
> be more conflict afterward and returning limited number of conflicting rows
> have no much use

Still I see your explanation differs from what the document patch says.

+      Currently, only unique or exclusion constraint violation
+      and rows formatting errors are ignored. Malformed
+      rows will rise warnings, while constraint violating rows
+      will be returned back to the caller.

I am afraid once this patch is part of next version of PostgreSQL, we
get many complains/inqueires from users. What about changing like this:

      Currently, only unique or exclusion constraint violation and
      rows formatting errors are ignored. Malformed rows will rise
      warnings, while constraint violating rows will be returned back
      to the caller unless any error is raised; i.e. if any error is
      raised due to error_limit exceeds, no rows will be returned back
      to the caller.

 Its better so amended .

regards
Surafel
Вложения

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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: table partitioning and access privileges
Следующее
От: Amit Langote
Дата:
Сообщение: Re: table partitioning and access privileges