From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adrian Klaver <adrian.klaver@gmail.com>
Cc: Kim Mortensen <kimfmx@gmail.com>
Cc: Hiroshi Saito <hiroshi@winpg.jp>
Cc: pgsql-odbc@postgresql.org
Subject: Re: problem connecting via ODBC when unicode (now in correct forum.).
Date: Fri, 21 Jan 2011 17:17:00 -0500
Message-ID: <747.1295648220@sss.pgh.pa.us> (raw)
In-Reply-To: <4D39F6F8.3080700@gmail.com>
References: <AANLkTinuVY9b8_unwNBL+-ijWJn8hA=mrAdapkwAPM4v@mail.gmail.com>
<201101210806.06568.adrian.klaver@gmail.com>
<AANLkTi=o0SACjKACKkZ5ZQ_HZyCPqveVZnSmvVPvpNUu@mail.gmail.com>
<201101210833.49544.adrian.klaver@gmail.com>
<AANLkTik785cfgrAHipBeJe+OKqxdpKYS0si=uaPhPK1M@mail.gmail.com>
<4D39CD82.6070101@winpg.jp>
<AANLkTimYsGV2cVmtY7JBgh1yrR2N2HW+NryEBa4MhB78@mail.gmail.com>
<4D39EC6A.6060304@gmail.com>
<AANLkTinX-Re+QXPhCb8PqatteaTthKnMtitQ2inuhgZh@mail.gmail.com>
<4D39F6F8.3080700@gmail.com>
Adrian Klaver <adrian.klaver@gmail.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
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-odbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, adrian.klaver@gmail.com, kimfmx@gmail.com, hiroshi@winpg.jp
Subject: Re: problem connecting via ODBC when unicode (now in correct forum.).
In-Reply-To: <747.1295648220@sss.pgh.pa.us>
References: <AANLkTinuVY9b8_unwNBL+-ijWJn8hA=mrAdapkwAPM4v@mail.gmail.com> <201101210806.06568.adrian.klaver@gmail.com> <AANLkTi=o0SACjKACKkZ5ZQ_HZyCPqveVZnSmvVPvpNUu@mail.gmail.com> <201101210833.49544.adrian.klaver@gmail.com> <AANLkTik785cfgrAHipBeJe+OKqxdpKYS0si=uaPhPK1M@mail.gmail.com> <4D39CD82.6070101@winpg.jp> <AANLkTimYsGV2cVmtY7JBgh1yrR2N2HW+NryEBa4MhB78@mail.gmail.com> <4D39EC6A.6060304@gmail.com> <AANLkTinX-Re+QXPhCb8PqatteaTthKnMtitQ2inuhgZh@mail.gmail.com> <4D39F6F8.3080700@gmail.com> <747.1295648220@sss.pgh.pa.us>
* 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