Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DFF5265031B for ; Fri, 11 Jul 2008 05:37:48 -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 51901-07 for ; Fri, 11 Jul 2008 05:37:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.175]) by postgresql.org (Postfix) with ESMTP id B19DB65003C for ; Fri, 11 Jul 2008 05:37:41 -0300 (ADT) Received: by wf-out-1314.google.com with SMTP id 25so3490877wfc.28 for ; Fri, 11 Jul 2008 01:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=0Yq1PZfpVkz+RS50FNPreJKC3vlOhleLfOeZnT3AKYw=; b=g5JZL0f2NYF+DOzHpSkDGylv1DERdMfhZ1pFAxBpZkVK9ew0VW59ZjnBz/lIoChZFg 4CJK+qc9Y4vY3X6yrBGiHDZ3IKOPsKbYTFFg/JAtbjs6tJiqZQX5XUarMCL3vU2M8GjL Ykwz8aHV7D2kHJu2xwP9sQuq1xu3wweqtWwI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=jpe8EH48JNrk1wM7lPNY9WsZkeBtNgB55kimR/5ScJicemvLwSizQ/T9QyrYspW/0O XlBlnNov02adS6SrTlYKW2OfEmXGIK4GazbpyzKrhdDjHIQXiYlWWQWE7l/Pu6dj3oPy xdYIvDNDHbYvCnL/RTTw1AYO8REMTezSsDCV4= Received: by 10.142.12.14 with SMTP id 14mr2966308wfl.308.1215765459714; Fri, 11 Jul 2008 01:37:39 -0700 (PDT) Received: by 10.142.222.13 with HTTP; Fri, 11 Jul 2008 01:37:39 -0700 (PDT) Message-ID: <57a815bf0807110137j198cb9e9gcb7d07405c42f42e@mail.gmail.com> Date: Fri, 11 Jul 2008 18:37:39 +1000 From: "Mikel Lindsaar" To: pgsql-admin@postgresql.org Subject: Re: Importing data - possible UTF8 import bug? In-Reply-To: <57a815bf0807101902o193644ear50e211e67663d874@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <57a815bf0807101902o193644ear50e211e67663d874@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL=0.001 X-Spam-Level: X-Archive-Number: 200807/111 X-Sequence-Number: 29721 OK, I'm mailing the list the results of my problem so future people can find it. The error was ERROR: invalid byte sequence for encoding "UTF8": 0xa2 with many different types of 0x... lines. The problem was indeed a bug, but one that sat between the keyboard and screen (that is, me), not with the COPY command. I didn't read the COPY docs well enough, in there it clearly states that a backslash followed by digits will be interpreted as a character with that numeric code (in the table). As the data I was importing contained addresses, it had a unit number and street number, like this; 2\554, so this was being interpreted as the number 2 followed by a character represented by \554 which was an invalid sequence and so rightly so, Copy failed and complained about an invalid char sequence. Going through the data set and replacing the backslashes with forward slashes (which works in my case) or if you need to be non destructive, replcaing the single backslash with a double backslash, handles the problem. Sorry all for the noise. Mikel -- http://lindsaar.net/ Rails, RSpec and Life blog....