pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Encoding for error messages during connect
Date: Thu, 17 Nov 2011 00:30:24 -0800
Message-ID: <4EC4C620.3010809@ejurka.com> (raw)
In-Reply-To: <ja2ftl$lud$1@dough.gmane.org>
References: <j935mi$ub7$1@dough.gmane.org>
	<ja2ftl$lud$1@dough.gmane.org>

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




view thread (3+ messages)

Message-ID: <4EC4C620.3010809@ejurka.com>
Permalink:  ../4EC4C620.3010809@ejurka.com/
Also on:    postgresql.org/message-id/4EC4C620.3010809@ejurka.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, spam_eater@gmx.net
  Subject: Re: Encoding for error messages during connect
  In-Reply-To: <4EC4C620.3010809@ejurka.com>
  References: <j935mi$ub7$1@dough.gmane.org> <ja2ftl$lud$1@dough.gmane.org> <4EC4C620.3010809@ejurka.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox