Re: Encoding for error messages during connect

From: Kris Jurka <books(at)ejurka(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Encoding for error messages during connect
Date: 2011-11-17 08:30:24
Message-ID: 4EC4C620.3010809@ejurka.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message fed 2011-11-18 01:52:22 latest jdbc driver (9.1-901) in maven repository?
Previous Message Thomas Kellerer 2011-11-17 08:17:47 Re: Encoding for error messages during connect