pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gregory S. Williamson <gsw@globexplorer.com>
To: azwa@nc.com.my
To: pgsql-sql@postgresql.org
Subject: Re: COPY command
Date: Thu, 8 Jan 2004 19:06:27 -0800
Message-ID: <71E37EF6B7DCC1499CEA0316A256832801057589@loki.wc.globexplorer.net> (raw)

This sounds as if the last character in each line might be a delimiter (a ",") which is standard for data unloaded from some sources; if this is the case try removing it and your data should load. Or you may have a comma in a character field and that is throwing off the count for the line in question ?

HTH,

Greg Williamson
DBA
GlobeXplorer LLC

-----Original Message-----
From:	azwa@nc.com.my [mailto:azwa@nc.com.my]
Sent:	Tue 1/6/2004 10:19 PM
To:	pgsql-sql@postgresql.org
Cc:	
Subject:	[SQL] COPY command

Hi,


  i try to load a file into temporary table but it gives me an error . do 
u have any idea/solutions ??  the command that i've running 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

FYI, my file was in comma delimiter type (csv) . My table structure as 
following :

    dwnc-# \dbiosadm.custdo_temp
         Table "biosadm.custdo_temp"
  Column  |         Type          | Modifiers
----------+-----------------------+-----------
 dono     | character varying(13) |
 dodate   | date                  |
 custname | character varying(70) |
 custlo   | character varying(40) |
 attnto   | character varying(80) |


Please guide me . thanks





view thread (8+ messages)  latest in thread

Message-ID: <71E37EF6B7DCC1499CEA0316A256832801057589@loki.wc.globexplorer.net>
Permalink:  ../71E37EF6B7DCC1499CEA0316A256832801057589@loki.wc.globexplorer.net/
Also on:    postgresql.org/message-id/71E37EF6B7DCC1499CEA0316A256832801057589@loki.wc.globexplorer.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: gsw@globexplorer.com, azwa@nc.com.my
  Subject: Re: COPY command
  In-Reply-To: <71E37EF6B7DCC1499CEA0316A256832801057589@loki.wc.globexplorer.net>
  References: <71E37EF6B7DCC1499CEA0316A256832801057589@loki.wc.globexplorer.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox