Re: String encoding during connection "handshake"

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: String encoding during connection "handshake"
Дата
Msg-id 20071127145848.GC19328@svana.org
обсуждение исходный текст
Ответ на String encoding during connection "handshake"  (sulfinu@gmail.com)
Ответы Re: String encoding during connection "handshake"  (sulfinu@gmail.com)
Список pgsql-hackers
On Tue, Nov 27, 2007 at 02:51:32PM +0200, sulfinu@gmail.com wrote:
> Simply put, what is the client encoding that the server assumes BEFORE the
> client connection is established, that is, during the authentication phase? I
> know there's a "client_encoding" setting on the server side that indicates
> the encoding used in the communication stream, but its default value is the
> database's encoding. Which is not known before the user gets authenticated
> and the "logical" connection is actually made.

I was under the impression that the username/password, had no encoding,
they are Just a Bunch of Bits, i.e. byte[]. Hence it is not relevent
what encoding the database is, it depends what encoding the DB admin
was using when the user was created. That solves your md5 problem.

Looking at it another way, the encoding is part of the password. The
correctly entered password in the wrong encoding is also wrong, because
the matching is done at the byte level.

So I suppose the answer is: whatever encoding you would like it to
be/what the DB admin uses.

This is all AIUI,

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Guillaume Smet"
Дата:
Сообщение: Re: 8.3devel slower than 8.2 under read-only load
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: PostGreSQL and recursive queries...