Re: Conflict handling for COPY FROM

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

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp



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

Предыдущее
От: Amit Langote
Дата:
Сообщение: tiny documentation fix
Следующее
От: Takashi Menjo
Дата:
Сообщение: RE: [PoC] Non-volatile WAL buffer