error-tolerant COPY FROM

Поиск
Список
Период
Сортировка
От Joolz
Тема error-tolerant COPY FROM
Дата
Msg-id 41196.10.0.4.254.1107520360.squirrel@webmail.arbodienst-limburg.nl
обсуждение исходный текст
Ответы Re: error-tolerant COPY FROM  (Mike Rylander <mrylander@gmail.com>)
Re: error-tolerant COPY FROM  (Michael Glaesemann <grzm@myrealbox.com>)
Re: error-tolerant COPY FROM  (Sean Davis <sdavis2@mail.nih.gov>)
Список pgsql-general
Hello everyone,

I'm building a postgresql db which will have to get lots of data
from "the outside" (customers, that is). The db has lots of
constraints, and I'm sure that our customers will offer lots of
invalid information. We receive the information in csv format. My
first thought was to read them into the database with COPY, but
"COPY stops operation at the first error."

What I need is an import where all valid lines from the csv files
are read into the db, and I also get a logfile for all invalid
lines, stating the line number plus the pg error message so I can
see which constraint was violated.

I can't think of a direct, elegant solution for this, does anyone
have any suggestions? Thanks a lot!


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

Предыдущее
От: Marco Colombo
Дата:
Сообщение: Re: Is there a peer-to-peer server solution with PG?
Следующее
От: Mike Rylander
Дата:
Сообщение: Re: error-tolerant COPY FROM