Re: import error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Vecernik <vecernik(at)aon(dot)at>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: import error
Date: 2003-01-28 15:28:26
Message-ID: 13248.1043767706@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Oliver Vecernik <vecernik(at)aon(dot)at> writes:
> My import gives following error:

> sport=# copy dives from '/var/n/tmp/ov.CSV' delimiters ',';
> ": can't parse "ne 1, pg_atoi: error in "0

The weird formatting of the error message suggests that the problem
is DOS-style newlines (CR/LF). COPY only likes Unix-style newlines
(LF). It thinks the CRs are part of the data, and then the datatype
input routines (like pg_atoi) spit up. Since pg_atoi spits back the
text it couldn't parse (including the CR), you get this bizarre-looking
overprinted message.

Solution: save the import file with Unix newlines, or run it through
a newline-fixing filter.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-01-28 15:32:35 Re: CR/LF conversion (was: import error)
Previous Message Oliver Vecernik 2003-01-28 14:46:07 CSV import