Re: Migrating from Sybase

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jens P(dot) Elsner" <jpelsner(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Migrating from Sybase
Date: 2000-07-24 03:36:01
Message-ID: 15200.964409761@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Jens P. Elsner" <jpelsner(at)gmx(dot)net> writes:
> ": can't parse "elsdb/import3.sql:419: ERROR: copy: line 1, pg_atoi: error in "":

> The stuff in 186.dat:

> WI-02.06.99-029|1999-06-02 11:04:13.184|Werk 1 Mue|KStK00-32/1|Mineralgemisch 0-30mm|||Halde B2, neue Anlage|1999-05-31 10:53:00.000|9922|1999-06-02||WP_B2||Manschke|3|1|A0170938384B|^M

I think it's unhappy about the last field, for which you're supplying an
empty string --- but the field is declared 'smallint' and so an empty
string isn't valid. Postgres does not consider an empty string to mean
NULL. You should write \N if you want COPY to produce a NULL.

BTW, I do not know whether the '^M's in your message were actually in
the original file, but that could be a problem too. I haven't tried it,
but I think that COPY wants Unix-style newlines (LF only) and is not
forgiving about accepting DOS-style newlines instead.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-07-24 03:46:33 Re: WaitOnLock error - what does this mean?
Previous Message hstenger 2000-07-24 03:29:25 ROLLBACK automatically