pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Thomas Goerner <tg@clickware.de>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6308: Problem w. encoding in client
Date: Tue, 29 Nov 2011 10:33:17 +0800
Message-ID: <4ED4446D.6010901@ringerc.id.au> (raw)
In-Reply-To: <788D6901C0544F20B394F44AE5B2E12B@tglaptp>
References: <788D6901C0544F20B394F44AE5B2E12B@tglaptp>

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

view thread (5+ messages)  latest in thread

Message-ID: <4ED4446D.6010901@ringerc.id.au>
Permalink:  ../4ED4446D.6010901@ringerc.id.au/
Also on:    postgresql.org/message-id/4ED4446D.6010901@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: ringerc@ringerc.id.au, tg@clickware.de
  Subject: Re: BUG #6308: Problem w. encoding in client
  In-Reply-To: <4ED4446D.6010901@ringerc.id.au>
  References: <788D6901C0544F20B394F44AE5B2E12B@tglaptp> <4ED4446D.6010901@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox