Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0OFjkq21246 for ; Wed, 24 Jan 2001 10:45:46 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f0OFjh912389; Wed, 24 Jan 2001 10:45:43 -0500 (EST) To: Sandis Jerics cc: pgsql sql Mailing List Subject: Re: i have a big trouble In-reply-to: <13115267721.20010124135004@mediaparks.lv> References: <3A6EAEEC.B294361D@ualg.pt> <13115267721.20010124135004@mediaparks.lv> Comments: In-reply-to Sandis Jerics message dated "Wed, 24 Jan 2001 13:50:04 +0200" Date: Wed, 24 Jan 2001 10:45:43 -0500 Message-ID: <12386.980351143@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200101/328 X-Sequence-Number: 1001 Sandis Jerics writes: > www_mod_lv=> \copy news from '/home/sites/www.mod.lv/web/news.sql' > \. > ERROR: copy: line 2, pg_atoi: error in " > At the international humanitarian mission of KFOR the Latvian unit participates with 10 soldiers from the National Armed Forces. The KFOR Latvian contingent - Military Police and medical units - will operate within the contingent of UK. " Notice that the complaint is from pg_atoi, so the problem is that the given text is being taken as an integer field --- that is, as the start of a new row of data. I suspect what is happening is that the embedded newlines in your text column are getting munged up so that they look like ordinary newlines (end of a data row) to COPY. A newline that is part of the data, and not a row separator, has to be represented as a backslash followed by a newline (\n) character. Anything that messes this up will confuse COPY. One theory that comes to mind is that you edited the dump file with an editor that converts Unix-style newlines (\n) to DOS-style (\r\n). Then your embedded newlines would become backslash \r \n ... in other words, a quoted \r followed by a regular end-of-row marker. regards, tom lane