Re: Newbie "Copy From" not working

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Walter Vaughan <wvaughan(at)steelerubber(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie "Copy From" not working
Date: 2006-08-17 20:45:47
Message-ID: 20060817204547.GA92357@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rodion Raskolnikov 2006-08-17 20:52:24 problem with postgres SQL db
Previous Message Brad Nicholson 2006-08-17 20:23:55 Re: Best approach for a "gap-less" sequence