Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9A1DF2E0273 for ; Wed, 12 Mar 2008 09:25:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 84790-09 for ; Wed, 12 Mar 2008 09:25:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by postgresql.org (Postfix) with ESMTP id 834282E018E for ; Wed, 12 Mar 2008 09:25:25 -0300 (ADT) Received: by fg-out-1718.google.com with SMTP id 22so2414484fge.23 for ; Wed, 12 Mar 2008 05:25:23 -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:reply-to:user-agent:mime-version:to:subject:content-type; bh=xqkqa+vlEMJFdkriw51OAmd1oJBkVF6sDUdi7jiqXZQ=; b=vhbsnochu+mo2VNVH6LD4LLUJzUxFJgJMo9NKVeRVOLUwcvXIlVvIfVLJ4c4s0P/sIr59brM2EBSmwmEciWdpT7s/eO/kg/i0Y1ZTIs+QJ3zXIh7O0uDS5PiKuefIo+AcHH+2CfjVVqZu2u6flpxn2X0qcA85mSbJ0j4y4Vtb9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject:content-type; b=Fv+EY6irXEtTDh7gCbMezJ1JHwN/aBSHq8/9t3hayvJDHclUXkI0G6ote1sAcJpgajG6XCWXB5m8yI+4nMxZYql6rG8Vnho3UDHyBN3j6WVlOONC1y0TGhr8RP0/0wJRbDtAXa06di/rTLo+y5LO1E7K+4Q0M6lLzvAVbtkpIaw= Received: by 10.86.68.20 with SMTP id q20mr762832fga.59.1205324721572; Wed, 12 Mar 2008 05:25:21 -0700 (PDT) Received: from ?10.1.1.103? ( [84.0.151.235]) by mx.google.com with ESMTPS id l19sm12385575fgb.0.2008.03.12.05.25.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Mar 2008 05:25:20 -0700 (PDT) Message-ID: <47D7CBAA.4090308@gmail.com> Date: Wed, 12 Mar 2008 13:25:14 +0100 From: Meetesh Karia Reply-To: meetesh.karia@alumni.duke.edu User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Encoding problems with migration from 8.0.14 to 8.3.0 on Windows Content-Type: multipart/alternative; boundary="------------040301060108070908000604" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200803/96 X-Sequence-Number: 28579 This is a multi-part message in MIME format. --------------040301060108070908000604 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi all, I'm trying to migrate from 8.0.14 on Windows (Vista Home Premium) to 8.3.0 and I've been trying to solve what appears to be an encoding problem. My old db was in the UNICODE encoding. I know that this isn't supported on 8.0.x, but it was a restore of a db from a Linux environment and postgres didn't appear to have any problems with it. My 8.3 server and client encodings are UTF8 and I used pg_dumpall (I tried the 8.0 and 8.3 versions) to dump the db. However, when I tried to restore the db, I got an error during index creation which wouldn't let me create a unique index on a column that had all unique values (it had the index in 8.0 and a group by having query with no indexes on the table confirms uniqueness). The thing that this column does have however is values like: 'Bruehl' 'Brühl' I created a blank table with the unique index on it and inserted rows one at a time until I confirmed that it was the above values that were causing a problem. Running the following query shows the difference in the hex encoded values (I changed my client encoding to WIN1250 to get the below to show up correctly): select name, encode(decode(name, 'escape'), 'hex') from ... name | encode ---------------+---------------------------- Daniel Brühl | 44616e69656c204272c3bc686c Daniel Bruehl | 44616e69656c2042727565686c (2 rows) I've also tried exporting using an encoding of WIN1250 but I get errors like this: pg_dump: Error message from server: ERROR: character 0xc383 of encoding "UNICODE" has no equivalent in "WIN1250" Anyone have any thoughts or suggestions? Why would the index creation fail? Is there a workaround? Thanks, Meetesh --------------040301060108070908000604 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi all,

I'm trying to migrate from 8.0.14 on Windows (Vista Home Premium) to 8.3.0 and I've been trying to solve what appears to be an encoding problem.  My old db was in the UNICODE encoding.  I know that this isn't supported on 8.0.x, but it was a restore of a db from a Linux environment and postgres didn't appear to have any problems with it.

My 8.3 server and client encodings are UTF8 and I used pg_dumpall (I tried the 8.0 and 8.3 versions) to dump the db.  However, when I tried to restore the db, I got an error during index creation which wouldn't let me create a unique index on a column that had all unique values (it had the index in 8.0 and a group by having query with no indexes on the table confirms uniqueness).  The thing that this column does have however is values like:

'Bruehl'
'Brühl'

I created a blank table with the unique index on it and inserted rows one at a time until I confirmed that it was the above values that were causing a problem.  Running the following query shows the difference in the hex encoded values (I changed my client encoding to WIN1250 to get the below to show up correctly):

select name, encode(decode(name, 'escape'), 'hex') from ...

     name      |           encode
---------------+----------------------------
 Daniel Brühl  | 44616e69656c204272c3bc686c
 Daniel Bruehl | 44616e69656c2042727565686c
(2 rows)

I've also tried exporting using an encoding of WIN1250 but I get errors like this:

pg_dump: Error message from server: ERROR:  character 0xc383 of encoding "UNICODE" has no equivalent in "WIN1250"

Anyone have any thoughts or suggestions?  Why would the index creation fail?  Is there a workaround?

Thanks,
Meetesh
--------------040301060108070908000604--