Re: {Spam}转发: [ADMIN] Copy cmd error

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: {Spam}转发: [ADMIN] Copy cmd error
Дата
Msg-id 200708281003.59158.dfontaine@hi-media.com
обсуждение исходный текст
Ответ на 转发: Copy cmd error  (<qinghuamail-postgresqlfans@yahoo.com>)
Список pgsql-admin
Hi,

Le mardi 28 août 2007, qinghuamail-postgresqlfans@yahoo.com a écrit :
> hi, after reading the source of pgloader,i have a idea,use perl to create
> the flat file, and, when error,reject the row,seek the next line,continue
> to copy.

That's pretty much what pgloader already does for you: if COPY errors out,
pgloader split the data in two groups and try to COPY again each of them,
until the dichotomy isolates the one row causing COPY the error.
Then the given row is appended to the configured reject_data file.

See those options for details:
  http://pgloader.projects.postgresql.org/

copy_every

When issuing COPY PostgreSQL commands, pgloader will not make a single big
COPY attempt, but copy copy_every lines at a time.
This parameter is optionnal and defaults to 10000.

reject_log
 In case of errors processing input data, a human readable log per rejected
input data line is produced into the reject_log file.

 reject_data
 In case of errors processing input data, the rejected input line is appended
to the reject_data file.

Maybe this feature should be better highlighted from the DESCRIPTION section
of the manpage (which is also the website).

Regards,
--
dim

Вложения

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

Предыдущее
От: Kevin Kempter
Дата:
Сообщение: Re: how to tell what tables have been vacuumed ?
Следующее
От: Jordi Mulet
Дата:
Сообщение: No restore of BLOB data (permissions?)