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 14C74D1B33F for ; Thu, 15 Jul 2004 20:24:30 -0300 (ADT) 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 26811-10 for ; Thu, 15 Jul 2004 23:24:29 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 144B5D1B26D for ; Thu, 15 Jul 2004 20:24:22 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BlFaJ-0000oK-00; Fri, 16 Jul 2004 11:24:15 +1200 Message-ID: <40F71217.8080304@opencloud.com> Date: Fri, 16 Jul 2004 11:24:07 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Dario V. Fassi" Cc: Tom Lane , "pgsql-jdbc@postgresql.org" Subject: Re: Very strange Error in Updates References: <40F6172D.10301@sistemat.com.ar> <40F619A0.8030506@opencloud.com> <40F61CC2.5030704@sistemat.com.ar> <40F61F0E.6020907@opencloud.com> <20559.1089900977@sss.pgh.pa.us> <40F6B35E.4010600@sistemat.com.ar> In-Reply-To: <40F6B35E.4010600@sistemat.com.ar> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/191 X-Sequence-Number: 10575 Dario V. Fassi wrote: > > My problem it's that the data is just inside the postgresql server (with > SQL_ASCII encoding), inserted by Win32/ODBC clients. > > Now from JDBC I can't handle any row with any field that has one o more > 8 bits characters. > At same time , Win32/ODBC programs continue to use it without any problem. > This situation let me in a hard to explain situation. The problem, as I understand it from Tom's explanation, is that SQL_ASCII only works if everyone is using the same client_encoding; the server has no knowledge of the real underlying encoding of the data so can't do conversions. JDBC always uses a client_encoding of UNICODE. I don't know what ODBC does, but apparently it's not using UNICODE. Perhaps one option is to set the database encoding to UNICODE, and either get the ODBC driver to issue an appropriate "SET client_encoding" on connection setup (I don't know if ODBC lets you do this) or set the default client_encoding in postgresql.conf to whatever is appropriate for ODBC clients? -O