Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id C60009FC6B0 for ; Thu, 25 Oct 2007 23:16:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 38542-05 for ; Thu, 25 Oct 2007 23:16:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from k2smtpout02-02.prod.mesa1.secureserver.net (k2smtpout02-02.prod.mesa1.secureserver.net [64.202.189.91]) by postgresql.org (Postfix) with SMTP id 3DF9E9FC663 for ; Thu, 25 Oct 2007 23:16:25 -0300 (ADT) Received: (qmail 30316 invoked from network); 26 Oct 2007 02:16:22 -0000 Received: from unknown (HELO mail.servantwebhosting.com) (68.178.159.82) by k2smtpout02-02.prod.mesa1.secureserver.net (64.202.189.91) with ESMTP; 26 Oct 2007 02:16:22 -0000 Received: (qmail 21847 invoked from network); 25 Oct 2007 19:16:22 -0700 Received: from s010600e0296eec95.mj.shawcable.net (HELO shach) (rob@nullmx.com@70.64.195.140) by mail.servantwebhosting.com with SMTP; 25 Oct 2007 19:16:22 -0700 From: "Chuck D." Reply-To: 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 User-Agent: KMail/1.9.6 References: <043e01c8174c$61157a50$8f01010a@iptel.com.ar> In-Reply-To: <043e01c8174c$61157a50$8f01010a@iptel.com.ar> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710252016.16121.pgsql-list@nullmx.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/128 X-Sequence-Number: 29500 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.