Re: Syntax error in a large COPY

Поиск
Список
Период
Сортировка
От Reg Me Please
Тема Re: Syntax error in a large COPY
Дата
Msg-id 200711071203.10865.regmeplease@gmail.com
обсуждение исходный текст
Ответ на Syntax error in a large COPY  (Reg Me Please <regmeplease@gmail.com>)
Список pgsql-general
Il Tuesday 06 November 2007 19:05:52 Reg Me Please ha scritto:
> Hi all.
> I'm generating an SQL script to load some million rows into a table.
> I'm trying to use the COPY command in order to speed the load up.
>
> At a certain point I get an error telling about a
> "invalid input syntax for type numeric"
>
> The incriminated line number is the last one (the one containing the \.).
>
> Is there a way to know which line is really malformed?
>
> Thanks.

Blame on me!
The problem (spotted thanks to the pgloader) was that I was using "\n" for
null values instead of "\N" (capital n).

As stated into the friendly documentation "\n" stands for "new line",
while "\N" stands for "NULL".

While being clearly stated, this choice is a little bit confusing, at least
for newbies like myself.

Thanks everyone and Dimitri Fontaine for his pgloader.

--
Reg me Please

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

Предыдущее
От: Reg Me Please
Дата:
Сообщение: Re: Syntax error in a large COPY
Следующее
От: André Volpato
Дата:
Сообщение: Re: Postgresql simple query performance question