Re: Encoding for error messages during connect - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Encoding for error messages during connect
Date
Msg-id 4EC4C620.3010809@ejurka.com
Whole thread Raw
In response to Re: Encoding for error messages during connect  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-jdbc
On 11/17/2011 12:17 AM, Thomas Kellerer wrote:

>> Now I don't think it would be possible for the driver to find out
>> which encoding to use for that stream before actually having a
>> connection. So it would need to evaluate some kind of client side
>> information, e.g. the lc_messages environment variable on the client
>> or through a connection property that would then be used to
>> initialize the stream correctly.
>>

It's not a good assumption that the client environment will match the
server environment.

>> Personally I'd prefer a connection property (something like
>> "messageEncoding") to control this as this can be part of the JDBC
>> URL which is usually configurable in a Java environment.

This seems more reasonable.  Previously we discussed how to send
usernames and passwords to the database because the encoding they are
sent in must match the encoding of the database these values were set in
(which may be different than the database you're connecting to).  At the
time we decided that a connection option to configure this wasn't the
right idea and now always send these values as UTF-8.  I don't recall
why we made that decision, but checking the archives might provide some
additional information on this case.

Kris Jurka


pgsql-jdbc by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Encoding for error messages during connect
Next
From: fed
Date:
Subject: latest jdbc driver (9.1-901) in maven repository?