From: | Reg Me Please <regmeplease(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Syntax error in a large COPY |
Date: | 2007-11-07 11:03:05 |
Message-ID: | 200711071203.10865.regmeplease@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Dimitri Fontaine | 2007-11-07 11:15:33 | Re: Syntax error in a large COPY |
Previous Message | Reg Me Please | 2007-11-07 10:50:14 | Re: Syntax error in a large COPY |