From: Chuck D. <pgsql-list@nullmx.com>
To: pgsql-sql@postgresql.org
Subject: Re: request for help with COPY syntax
Date: Thu, 25 Oct 2007 20:16:15 -0600
Message-ID: <200710252016.16121.pgsql-list@nullmx.com> (raw)
In-Reply-To: <043e01c8174c$61157a50$8f01010a@iptel.com.ar>
References: <043e01c8174c$61157a50$8f01010a@iptel.com.ar>
On October 25, 2007 03:16:59 pm Fernando Hevia wrote:
>
> As I understand it when a line starts with $ you would like to merge it
> with the previous line.
>
No, it appears the data file I am attempting to COPY has some records with
fields that contain a CR/LF in the data of that field. Postgres COPY fails
like this:
ERROR: literal carriage return found in data
HINT: Use "\r" to represent carriage return.
CONTEXT: COPY orig_city_world, line 1071850
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.
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: pgsql-list@nullmx.com
Subject: Re: request for help with COPY syntax
In-Reply-To: <200710252016.16121.pgsql-list@nullmx.com>
* 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