Re: COPY error

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: ABHANG RANE <arane(at)indiana(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY error
Date: 2007-06-05 09:04:27
Message-ID: 20070605090427.GA67905@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 04, 2007 at 02:12:00PM -0400, ABHANG RANE wrote:
> Im trying to load data from a file using copy command. At the end of
> the data, I have appended copy statement as
>
> copy tablename(col1, col2) from stdin with delimiter as '\t';
> .\

COPY should go before the data and end-of-data (\. not .\) should
go after the data. Also, in text mode the default delimiter is the
tab character (\t) so you can omit it unless you prefer to be
explicit. Try something like this (with a tab after 2713):

copy tablename (col1, col2) from stdin;
2713 {3.70952,1.45728,0.134339,3.99197,2.22381,-0.435095,6.9}
\.

--
Michael Fuhr

In response to

  • COPY error at 2007-06-04 18:12:00 from ABHANG RANE

Browse pgsql-general by date

  From Date Subject
Next Message Marc Compte 2007-06-05 09:49:20 Foreign keys and indexes
Previous Message Martijn van Oosterhout 2007-06-05 07:55:19 Re: $libdir