Using COPY FROM on a subset of the file's column

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Using COPY FROM on a subset of the file's column
Дата
Msg-id k7nrc9$7l8$1@ger.gmane.org
обсуждение исходный текст
Ответы Re: Using COPY FROM on a subset of the file's column  (Craig Ringer <craig@2ndQuadrant.com>)
Список pgsql-general
Hello,

I'm trying to import a text file into a table using the COPY command.

The text file contains four columns: id, col_1, col_2, col_3 (in that order).
My target table only has id and col_1.

 From the documentation I assumed that the following statement

   copy foo (id, col_1)
   from 'foo.txt'
   with (format csv, delimiter ';', header true);

would only import id and col_1, but instead it fails with "ERROR:  extra data after last expected column".

Am I missing something, or is this a limitation of the COPY command?

Regards
Thomas

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Running out of memory while making a join
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Using COPY FROM on a subset of the file's column