From: Oliver Jowett <oliver@opencloud.com>
To: mbch67@yahoo.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: 8.0.0beta4: "copy" and "client_encoding"
Date: Thu, 04 Nov 2004 09:12:56 +1300
Message-ID: <41893BC8.6000201@opencloud.com> (raw)
In-Reply-To: <fe065ce.0411030803.4616e8c4@posting.google.com>
References: <fe065ce.0411030803.4616e8c4@posting.google.com>
mbch67@yahoo.com wrote:
> Hi,
>
> The following statement worked fine with 7.4 but fails under 8.0.0beta4:
>
> SET CLIENT_ENCODING TO 'LATIN1';
>
> Error message:
>
> 08006
> The servers client_encoding parameter was changed to {0}.
> The JDBC driver requires client_encoding to be UNICODE for
> correct operation.
>
> Is this a bug or a new restriction of the JDBC driver/server backend?
It's an old restriction of the JDBC driver. It's just that only the new
driver detects and complains about attempts to change the encoding.
The underlying problem is that currently the driver sets client_encoding
= UNICODE (which matches the internal Java string representation well)
and expects it to stay that way for the duration of the connection. If
you manually change client_encoding, then the driver will happily try to
decode those LATIN1-encoded strings as UTF8-encoded strings, and get
very confused..
Why do you need to change client_encoding?
-O
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-jdbc@postgresql.org
Cc: oliver@opencloud.com, mbch67@yahoo.com
Subject: Re: 8.0.0beta4: "copy" and "client_encoding"
In-Reply-To: <41893BC8.6000201@opencloud.com>
References: <fe065ce.0411030803.4616e8c4@posting.google.com> <41893BC8.6000201@opencloud.com>
* 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