Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1BE321337BC8 for ; Fri, 21 Jan 2011 20:45:30 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 22567-05-5 for ; Sat, 22 Jan 2011 00:45:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 069111337BCE for ; Fri, 21 Jan 2011 20:45:14 -0400 (AST) Received: by vws16 with SMTP id 16so998332vws.19 for ; Fri, 21 Jan 2011 16:45:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:reply-to:to:subject:date:user-agent:cc :references:in-reply-to:mime-version:content-disposition:x-length :x-uid:content-type:content-transfer-encoding:message-id; bh=8WrPGkKL9IfFiX4WvVkK6n75W/eoS74OmnsoWJtXSUE=; b=kXRk4h/vhTDXwJ//SAtxh9c/gQvmMYINiHYUo+7cYnAnN8WWPFsUkeuVQCejdw9x+0 QDRlwytMY/pHo+9hj31K/+dCE4g0Oq3r0YE1KT9CfqEkCukr3dy1MbYxbKYIfvSn/xEt Z7uFZLCohp5kNgiZAMNlEt5knK8CzVpqHCqlE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-disposition:x-length:x-uid:content-type :content-transfer-encoding:message-id; b=khaa4L0AXzjMqD1uCzBIEaO/y01qjePQQf+YPTqT07GSw1/8aG4yLNIkkyjil3PeMd B+CPnRMC+Mgc8foz0OQRJcG2onjownnf56jntXzr+cyxzgIKs9fEZQNTDnVhLNm4PamL ZyChABYwgQBUwXXtZkJ+4NAKsRIWaPa16w4I4= Received: by 10.220.110.38 with SMTP id l38mr347534vcp.238.1295657115077; Fri, 21 Jan 2011 16:45:15 -0800 (PST) Received: from tucker.local (c-24-17-164-54.hsd1.wa.comcast.net [24.17.164.54]) by mx.google.com with ESMTPS id b6sm3492238vci.24.2011.01.21.16.45.13 (version=SSLv3 cipher=RC4-MD5); Fri, 21 Jan 2011 16:45:14 -0800 (PST) From: Adrian Klaver Reply-To: adrian.klaver@gmail.com To: Tom Lane Subject: Re: problem connecting via ODBC when unicode (now in correct forum.). Date: Fri, 21 Jan 2011 16:45:12 -0800 User-Agent: KMail/1.9.10 Cc: Kim Mortensen , Hiroshi Saito , pgsql-odbc@postgresql.org References: <4D39F6F8.3080700@gmail.com> <747.1295648220@sss.pgh.pa.us> In-Reply-To: <747.1295648220@sss.pgh.pa.us> MIME-Version: 1.0 Content-Disposition: inline X-Length: 3250 X-UID: 30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101211645.12847.adrian.klaver@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201101/19 X-Sequence-Number: 10566 On Friday 21 January 2011 2:17:00 pm Tom Lane wrote: > Adrian Klaver writes: > > I believe the problem, as Hiroshi Saito pointed out, is that the client > > encoding is being set on Windows before the connection is attempted and > > that it is picking the wrong one. Per his post pgAdmin and JDBC are > > probably just starting with UTF8 and that is why they succeed. At this > > point I don't know how to get around that. > > AFAIK the only way to get the mentioned error message (about "no > pg_hba.conf entry") from this kind of problem is if the DBA is listing > user names directly in pg_hba.conf. Since there is no encoding > conversion active this early in backend startup, non-ASCII user names can > only work if the encoding used in pg_hba.conf matches what is arriving > from the client. In the message(s) that went private was the pg_hba.conf. It did have some specific usernames. > > Possible solution: make *two* (or more) entries in pg_hba.conf, one in > each encoding that clients might be using. This is probably > unmaintainable though, particularly when using Windows editors which are > almost certainly going to think they know more than you do about > encodings. > > Better idea: refrain from mentioning specific usernames in pg_hba.conf. > Usually, anything you might want to do that way can be done better in > other ways. For instance, make use of the CONNECT privilege if you're > running a release new enough to have it. When I tested I used 'all' for users to get around the above problem. It got me past the no pg_hba.conf entry problem. > > By and large, though, non-ASCII user names are going to be problematic > anyway --- even if you got past the pg_hba.conf check, I think you might > just get a "no such user" failure when the client sends the name in an > encoding that doesn't match what's in the system catalog. This is an > area that's known to need work. What I saw, for the record, in the Windows error message was: FATAL:password authentication failed for user "?" > > regards, tom lane -- Adrian Klaver adrian.klaver@gmail.com