Re: data loading

From: Richard Huxton <dev(at)archonet(dot)com>
To: azwa(at)nc(dot)com(dot)my, pgsql-sql(at)postgresql(dot)org
Subject: Re: data loading
Date: 2004-01-09 20:04:48
Message-ID: 200401092004.48865.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Friday 09 January 2004 02:13, azwa(at)nc(dot)com(dot)my wrote:
> Hi,
>
>
> i try to load data from flat file (comma delimiter format) into
> temporary table . i use COPY command as below:
>
> dwnc=# copy biosadm.custdo_temp
> dwnc-# from '/home/bios/customer_data/CustomerDO_new.CSV'
> dwnc-# WITH DELIMITER ',' ;
>
> ERROR: copy: line 141, Extra data after last expected column

Does line 141 (or nearby) have a comma somewhere in its data? That would fool
the COPY into mis-counting the columns. See the COPY entry in the SQL Command
Reference chapter of the manuals - you'll want to escape any commas with a
backslash:
\,

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2004-01-09 20:06:01 Re: data loading
Previous Message Daniel Lau 2004-01-09 15:44:36 Re: Type conversion from TEXT to DOUBLE PRECISION