X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5196E3A4559 for ; Wed, 3 Nov 2004 20:11:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76689-02 for ; Wed, 3 Nov 2004 20:11:16 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 749053A455D for ; Wed, 3 Nov 2004 20:11:17 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CPRTG-0003pz-00; Thu, 04 Nov 2004 09:11:06 +1300 Message-ID: <41893BC8.6000201@opencloud.com> Date: Thu, 04 Nov 2004 09:12:56 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.8 (X11/20041021) X-Accept-Language: en-us, en MIME-Version: 1.0 To: mbch67@yahoo.com Cc: pgsql-jdbc@postgresql.org Subject: Re: 8.0.0beta4: "copy" and "client_encoding" References: In-Reply-To: X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=MAILTO_TO_SPAM_ADDR X-Spam-Level: * X-Archive-Number: 200411/49 X-Sequence-Number: 11471 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