Skip site navigation (1) Skip section navigation (2)

Re: problem connecting via ODBC when unicode (now in correct forum.).

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: Kim Mortensen <kimfmx(at)gmail(dot)com>, Hiroshi Saito <hiroshi(at)winpg(dot)jp>, pgsql-odbc(at)postgresql(dot)org
Subject: Re: problem connecting via ODBC when unicode (now in correct forum.).
Date: 2011-01-21 22:17:00
Message-ID: 747.1295648220@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-odbc
Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> 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.

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.

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.

			regards, tom lane

In response to

Responses

pgsql-odbc by date

Next:From: Adrian KlaverDate: 2011-01-22 00:45:12
Subject: Re: problem connecting via ODBC when unicode (now in correct forum.).
Previous:From: Adrian KlaverDate: 2011-01-21 21:36:47
Subject: Re: problem connecting via ODBC when unicode (now in correct forum.).

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group