Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id EA9A119427CD for ; Mon, 28 Nov 2011 22:33:46 -0400 (AST) Received: from mail-vx0-f174.google.com ([209.85.220.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RVDVx-0000Qc-IN for pgsql-bugs@postgresql.org; Tue, 29 Nov 2011 02:33:46 +0000 Received: by vcbfk14 with SMTP id fk14so4243383vcb.19 for ; Mon, 28 Nov 2011 18:33:31 -0800 (PST) Received: by 10.220.2.209 with SMTP id 17mr5489430vck.195.1322534011553; Mon, 28 Nov 2011 18:33:31 -0800 (PST) Received: from ayaki.localdomain (124-169-45-65.dyn.iinet.net.au. [124.169.45.65]) by mx.google.com with ESMTPS id k4sm51695585vdu.2.2011.11.28.18.33.27 (version=SSLv3 cipher=OTHER); Mon, 28 Nov 2011 18:33:30 -0800 (PST) Message-ID: <4ED4446D.6010901@ringerc.id.au> Date: Tue, 29 Nov 2011 10:33:17 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: Thomas Goerner CC: pgsql-bugs@postgresql.org Subject: Re: BUG #6308: Problem w. encoding in client References: <788D6901C0544F20B394F44AE5B2E12B@tglaptp> In-Reply-To: <788D6901C0544F20B394F44AE5B2E12B@tglaptp> Content-Type: multipart/alternative; boundary="------------040308010806090904040603" X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201111/204 X-Sequence-Number: 31799 This is a multi-part message in MIME format. --------------040308010806090904040603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 11/28/2011 08:26 PM, Thomas Goerner wrote: > > Hello Craig, > > thanks for your answer. > > > Restore using PgAdmin III or using a unicode console. > > > This is a limitation of using a Win1252 client encoding when restoring > > > data that isn't restricted to Win1252 and cannot be fixed directly. > > That's new to me. AFAIK pg_restore looks into the dump file and sets > the client encoding accordingly (In fact the dump contains the > statement SET client_encoding = 'UTF8';). Is this overridden by > PGCLIENTENCODING? And if so, should it be? > Nope, pg_restore should be using UTF8 as the client encoding in that case. If there are any errors or notices it won't be able to emit them correctly on the terminal though, as win1252 can't represent everything in UTF8 (and IIRC pg_restore doesn't recode from client_encoding to terminal encoding anyway). If the restore its self is failing then I agree that something's not working properly, because you should be able to use a client_encoding different to your terminal encoding. I wonder if recent changes intended to get psql to pick up the terminal encoding automatically have had the unintended side-effect of overriding pg_restore's attempt to set the client_encoding? I'm rather surprised you only see this on x64. You're using the same Windows and Pg version for both x64 and x64 but only the x64 test fails? -- Craig Ringer --------------040308010806090904040603 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 11/28/2011 08:26 PM, Thomas Goerner wrote:

Hello Craig,

 

thanks for your answer.

 

 

> Restore using PgAdmin III or using a unicode console.

> This is a limitation of using a Win1252 client encoding when restoring

> data that isn't restricted to Win1252 and cannot be fixed directly.

 

That's new to me. AFAIK pg_restore looks into the dump file and sets the client encoding accordingly (In fact the dump contains the statement SET client_encoding = 'UTF8';). Is this overridden by PGCLIENTENCODING? And if so, should it be?


Nope, pg_restore should be using UTF8 as the client encoding in that case. If there are any errors or notices it won't be able to emit them correctly on the terminal though, as win1252 can't represent everything in UTF8 (and IIRC pg_restore doesn't recode from client_encoding to terminal encoding anyway).

If the restore its self is failing then I agree that something's not working properly, because you should be able to use a client_encoding different to your terminal encoding. I wonder if recent changes intended to get psql to pick up the terminal encoding automatically have had the unintended side-effect of overriding pg_restore's attempt to set the client_encoding?

I'm rather surprised you only see this on x64. You're using the same Windows and Pg version for both x64 and x64 but only the x64 test fails?

--
Craig Ringer
--------------040308010806090904040603--