Re: Newbie "Copy From" not working - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Newbie "Copy From" not working
Date
Msg-id 20060817204547.GA92357@winnie.fuhr.org
Whole thread Raw
In response to Newbie "Copy From" not working  (Walter Vaughan <wvaughan@steelerubber.com>)
Responses Re: Newbie "Copy From" not working  (Walter Vaughan <wvaughan@steelerubber.com>)
List pgsql-general
On Thu, Aug 17, 2006 at 03:27:26PM -0400, Walter Vaughan wrote:
> Admin_=# COPY DATA_IMPORT_CUSTOMER FROM '/tmp/sold.pg' delimiter '|' null
> '';
> ERROR:  missing data for column "processed_timestamp"
> CONTEXT:  COPY data_import_customer, line 1: "(xxx) xxx-xxxx||Mary|Smith|76
> Crest Street||Jersey City|NJ|07302-0000|New Jersey|USA||XXX|XXX-1..."

The table you posted has 42 columns; at least one line in the file
doesn't have that many fields.  Here's an easy way to count the
number of fields on each line in the file:

awk -F'|' '{print NR, NF}' /tmp/sold.pg

Suggestion: fix the file so each line has the same number of fields
as the table has columns.

--
Michael Fuhr

pgsql-general by date:

Previous
From: Brad Nicholson
Date:
Subject: Re: Best approach for a "gap-less" sequence
Next
From: "Alexander Farber"
Date:
Subject: select * from users where user_id NOT in (select ban_userid from banlist)