Re: copy command - date

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: copy command - date
Дата
Msg-id 13673.1186970077@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: copy command - date  (novice <user.postgresql@gmail.com>)
Список pgsql-general
novice <user.postgresql@gmail.com> writes:
> db5=>  \copy maintenance FROM test.txt
> ERROR:  invalid input syntax for integer: "3665   OK           SM
> 07/07/13 06:09"
> CONTEXT:  COPY maintenance, line 1, column maintenance_id: "3665   OK
>          SM 07/07/13 06:09"

It looks to me like your problem is mostly that you don't have tabs
between the fields.  I don't think COPY can be taught to parse this
input directly --- you need to preprocess the file to split the fields
apart.

BTW: after you get it split into fields, you're also going to find that
"OK" is not valid input for the integer "meter_id" column.

            regards, tom lane

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

Предыдущее
От: novice
Дата:
Сообщение: Re: copy command - date
Следующее
От: Paul Lambert
Дата:
Сообщение: Re: copy command - date