Re: [GENERAL] import CSV file to a table

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [GENERAL] import CSV file to a table
Дата
Msg-id CAKFQuwbur63EfDN=rf6S_DKUVgyHrEp9yMJmovTQDCWkyEeJ8w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] import CSV file to a table  (Karl Czajkowski <karlcz@isi.edu>)
Список pgsql-general
On Wed, Mar 8, 2017 at 9:13 AM, Karl Czajkowski <karlcz@isi.edu> wrote:

With the temporary table, you can use SQL for most validation or data
interrogation, but you need to know at least enough schema information
in advance to form the COPY statement. Parsing the CSV header row to
plan your work puts you right back to requiring a robust CSV parser
unless you can constrain your input scenarios to only handle very
trivial headers.

​You can write the entire contents of the CSV into a psql variable and process the text blob from there using intermediate arrays.

David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] Unable to start postgresql
Следующее
От: Rob Sargent
Дата:
Сообщение: Re: [GENERAL] import CSV file to a table