From: Tom Lane <tgl@sss.pgh.pa.us>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Antoine <plaskowski.stanislas@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Windows locale cause server to send invalid data encoding to client
Date: Wed, 14 Jul 2021 10:19:59 -0400
Message-ID: <3484083.1626272399@sss.pgh.pa.us> (raw)
In-Reply-To: <20210714135052.bg5ywhl7p23tnjmg@nol>
References: <CAO16vDNM5_eUZG3unbumx2AJt11VZxuQxn9cSZ9VhSCpD1TMgw@mail.gmail.com>
<20210714135052.bg5ywhl7p23tnjmg@nol>
Julien Rouhaud <rjuju123@gmail.com> writes:
> On Wed, Jul 14, 2021 at 01:49:24PM +0200, Antoine wrote:
>> I set up a postgresql server on Windows 10 and connected it using Rust, but
>> the Rust client reports invalid UTF-8 data when the password is wrong. I
>> use a french locale windows that contain some accents "éèê" etc.
> This is unfortunately working as designed. The client encoding can't be set
> during startup (and authentication is part of it), see
> https://github.com/postgres/postgres/blob/master/src/backend/utils/mb/mbutils.c#L85-L88
> for more details about it:
It seems like the core problem is that the "authentication failed" error
text may be sent in an unexpected encoding. I wonder if we should decline
to translate any error messages until we've established the requested
client encoding. Sending the message in English isn't ideal either,
but it'd avoid this hazard.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rjuju123@gmail.com, plaskowski.stanislas@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Windows locale cause server to send invalid data encoding to client
In-Reply-To: <3484083.1626272399@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