Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 296355B59E2 for ; Thu, 17 Nov 2011 04:30:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 63685-03 for ; Thu, 17 Nov 2011 08:30:35 +0000 (UTC) Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 6A73A5B59E1 for ; Thu, 17 Nov 2011 04:30:34 -0400 (AST) Received: from locatortechnologies.com ([198.64.129.55] helo=www.locatortechnologies.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RQxMf-0004iN-Ml for pgsql-jdbc@postgresql.org; Thu, 17 Nov 2011 08:30:34 +0000 Received: from [192.168.7.181] (cpe-24-24-224-57.socal.res.rr.com [24.24.224.57]) by www.locatortechnologies.com (Postfix) with ESMTP id 0EE9E620004; Thu, 17 Nov 2011 03:30:19 -0500 (EST) Message-ID: <4EC4C620.3010809@ejurka.com> Date: Thu, 17 Nov 2011 00:30:24 -0800 From: Kris Jurka User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Thomas Kellerer CC: pgsql-jdbc@postgresql.org Subject: Re: Encoding for error messages during connect References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/39 X-Sequence-Number: 22374 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