Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

Поиск
Список
Период
Сортировка
От jian he
Тема Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row
Дата
Msg-id CACJufxFFU92-H7G8tmpxt9oTSfL062OA7n5rPx-YbOAtDUUzGw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row  (Yugo NAGATA <nagata@sraoss.co.jp>)
Ответы Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row  (torikoshia <torikoshia@oss.nttdata.com>)
Список pgsql-hackers
The idea of on_error is to tolerate errors, I think.
if a column has a not null constraint, let it cannot be used with
(on_error 'null')

Based on this, I've made a patch.
based on COPY Synopsis: ON_ERROR 'error_action'
on_error 'null', the  keyword NULL should be single quoted.

demo:
COPY check_ign_err FROM STDIN WITH (on_error 'null');
1 {1} a
2 {2} 1
3 {3} 2
4 {4} b
a {5} c
\.

\pset null NULL

SELECT * FROM check_ign_err;
  n   |  m  |  k
------+-----+------
    1 | {1} | NULL
    2 | {2} |    1
    3 | {3} |    2
    4 | {4} | NULL
 NULL | {5} | NULL

Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Is this a problem in GenericXLogFinish()?
Следующее
От: jian he
Дата:
Сообщение: on_error table, saving error info to a table