Re: Syntax error in a large COPY - Mailing list pgsql-general

From Reg Me Please
Subject Re: Syntax error in a large COPY
Date
Msg-id 200711071203.10865.regmeplease@gmail.com
Whole thread Raw
In response to Syntax error in a large COPY  (Reg Me Please <regmeplease@gmail.com>)
List 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 by date:

Previous
From: Reg Me Please
Date:
Subject: Re: Syntax error in a large COPY
Next
From: André Volpato
Date:
Subject: Re: Postgresql simple query performance question