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 60309563F1 for ; Wed, 16 Mar 2005 11:23:58 +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 36698-08 for ; Wed, 16 Mar 2005 11:23:49 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 032E65659B for ; Wed, 16 Mar 2005 11:23:47 +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 1DBWcq-0003gC-00; Thu, 17 Mar 2005 00:23:44 +1300 Message-ID: <4238173D.60307@opencloud.com> Date: Thu, 17 Mar 2005 00:23:41 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Javier_Y=E1=F1ez?= Cc: pgsql-jdbc@postgresql.org Subject: Re: Charset encoding patch to JDBC driver References: <4237FC9B.4000709@cibal.es> In-Reply-To: <4237FC9B.4000709@cibal.es> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/151 X-Sequence-Number: 12543 Javier Yáñez wrote: > I have the necesity of to keep a PostgreSQL database with SQL-ASCII. As > the actual version of pgjdbc only have support for Unicode (at least for > jdbc3), I have make a patch that allow to configure the desired charset. I'm uncomfortable with applying this sort of patch to the official driver, since it makes the driver more complex just to handle what is arguably a database misconfiguration. It also introduces a new class of error: a mismatch between the driver's configured charSet and the actual database. Comments on the patch itself: - it is missing changes to the v2 protocol path - why does it remove the client_encoding sanity check on connect? - since encoding does not change for the lifetime of the connection, can't you make the encoding a field of QueryExecutoryImpl rather than passing it around everywhere? - it may be better to pass encoding as a parameter to SimpleParameterList methods that need it, rather than storing the (same) value on every list instance. -O