Re: import csv file into table

Поиск
Список
Период
Сортировка
Искать
От
David G. Johnston
Тема
Re: import csv file into table
Дата
Msg-id
CAKFQuwaoRsfOuBxjnKd4ott_i7qjpbFnZSCtTiM+V2XTOwtMfg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Re: import csv file into table Jude DaShiell <jdashiel@panix.com>
On Fri, Jun 12, 2015 at 11:38 AM, Jude DaShiell <jdashiel@panix.com> wrote:
​[...]
 and ' for beginning and end of records 
​[...]

​This is the problem.  You need to remove the first and last single-quote and ensure that fields do not contain embedded commas.  COPY will work if those two things hold true.  Embedded commas and field quoting are the main difficulties with using comma-separated format.​

COPY is efficient but it expects you to provide clean data to it.  You need to fix those items externally to PostgreSQL.

I have not used it myself but you might evaluate pgloader.

David J.

В списке pgsql-novice по дате отправления
От: Jude DaShiell
Дата:
Сообщение: import csv file into table
От: Jude DaShiell
Дата:
Сообщение: Re: import csv file into table
FAQ