Re: Re: [bug fix] multibyte messages are displayed incorrectly on the client

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: [bug fix] multibyte messages are displayed incorrectly on the client
Дата
Msg-id 20513.1389402180@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [bug fix] multibyte messages are displayed incorrectly on the client  (Noah Misch <noah@leadboat.com>)
Ответы Re: Re: [bug fix] multibyte messages are displayed incorrectly on the client  (Noah Misch <noah@leadboat.com>)
Список pgsql-hackers
Noah Misch <noah@leadboat.com> writes:
>> On Sun, Jan  5, 2014 at 04:40:17PM +0900, MauMau wrote:
>>> Then, as a happy medium, how about disabling message localization
>>> only if the client encoding differs from the server one?  That is,
>>> compare the client_encoding value in the startup packet with the
>>> result of GetPlatformEncoding().  If they don't match, call
>>> disable_message_localization().

> I like this proposal.  Thanks.
> ...
> Agreed.  You would need to poke into the relevant part of the startup packet
> much earlier than we do today, but that's tractable.

There's still the problem of what to do before we have a complete startup
packet, or if the packet is defective enough to not contain a recognizable
client encoding.

Perhaps more to the point, what it sounds like this is doing is creating
a third behavioral state, in between what prevails when we're first
reading the packet and what prevails after we've finally adopted the
requested client encoding.  I'm less than convinced that's a good thing.

I'm also rather unexcited by the idea of introducing redundant and/or
ad-hoc code to parse the startup packet.  That sounds like a recipe for
bugs, some of which might even rise to security issues, considering it
would happen before client authentication.

I think if we're going to do anything like this at all, it'd be best
just to disable localization from postmaster fork up till we've gotten
a client encoding out of the packet in the normal course of events.
        regards, tom lane



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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Standalone synchronous master