Re: request for help with COPY syntax

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-list(at)nullmx(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: request for help with COPY syntax
Date: 2007-10-26 03:22:10
Message-ID: 2080.1193368930@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Chuck D." <pgsql-list(at)nullmx(dot)com> writes:
> I tried this, which I found on the web from Tom Lane:

> sed 's/^M/\\r/g' geonames.txt > geonames_fixed.txt

> But still get the same error. I used ctrl-v ctrl-m to reproduce the
> ^M. Not sure why it is kicking out those lines still.

Did the sed actually do anything? (Hint: the file size of
geonames_fixed.txt would be larger than geonames.txt if it did.
Or you could diff the two files to confirm that something sensible
happened.)

I suspect that your shell may be fouling things up here. You may need
to prepare this command as a one-line shell script, using an editor that
doesn't barf on bare carriage returns ...

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Chuck D. 2007-10-26 04:26:17 Re: request for help with COPY syntax
Previous Message Chuck D. 2007-10-26 02:16:15 Re: request for help with COPY syntax