Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A23966509DF for ; Fri, 11 Jul 2008 00:51:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 48359-06-2 for ; Fri, 11 Jul 2008 00:50:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 550176509EE for ; Fri, 11 Jul 2008 00:32:40 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m6B3Wc5u023595; Thu, 10 Jul 2008 23:32:38 -0400 (EDT) To: "Mikel Lindsaar" cc: pgsql-admin@postgresql.org Subject: Re: Importing data - possible UTF8 import bug? In-reply-to: <57a815bf0807101902o193644ear50e211e67663d874@mail.gmail.com> References: <57a815bf0807101902o193644ear50e211e67663d874@mail.gmail.com> Comments: In-reply-to "Mikel Lindsaar" message dated "Fri, 11 Jul 2008 12:02:01 +1000" Date: Thu, 10 Jul 2008 23:32:38 -0400 Message-ID: <23594.1215747158@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/109 X-Sequence-Number: 29719 "Mikel Lindsaar" writes: > But I am hitting a problem. When I try to import the result with COPY > I am getting: > ERROR: invalid byte sequence for encoding "UTF8": 0xa2 > And gives me a line reference. > I then grabbed that line out of the file, unpacked each byte into a > decimal representation and 162 does not appear anywhere. Sure you're counting the lines right? I believe the number COPY gives you is the N'th line of COPY data (ie, N lines after the COPY command) --- not the N'th line of the whole file. Another thing to check is whether embedded newlines &such are throwing off your count. regards, tom lane