Re: Charset encoding patch to JDBC driver - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Charset encoding patch to JDBC driver
Date
Msg-id 4238173D.60307@opencloud.com
Whole thread Raw
In response to Charset encoding patch to JDBC driver  (Javier Yáñez <javier@cibal.es>)
Responses Re: Charset encoding patch to JDBC driver
Re: Charset encoding patch to JDBC driver
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Javier Yáñez
Date:
Subject: Charset encoding patch to JDBC driver
Next
From: "mikael-aronsson"
Date:
Subject: Arrays