Re: handling unconvertible error messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: handling unconvertible error messages
Date
Msg-id 677.1471104150@sss.pgh.pa.us
Whole thread Raw
In response to Re: handling unconvertible error messages  (Victor Wagner <vitus@wagner.pp.ru>)
Responses Re: handling unconvertible error messages  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Re: handling unconvertible error messages  (Victor Wagner <vitus@wagner.pp.ru>)
List pgsql-hackers
Victor Wagner <vitus@wagner.pp.ru> writes:
> I think it is better to avoid such a problem and fix system so server
> would never send a message in the encoding, different from client one.

Don't hold your breath waiting for that to happen.

Quite aside from the question of whether we want to trust GUC settings
from the startup packet before we've authenticated the user, there's a
small problem that the server *can't* translate *any* encoding until
it's successfully connected to a database and is able to read the
pg_conversion catalog.

We might be able to institute some rule like "examine the startup
packet and see if it specifies a client_encoding different from what
we inherited from the postmaster.  If not, continue with current
behavior (send messages localized per postmaster's settings).  If so,
fall back to English messages/C locale until startup is complete."
This would preserve current functionality in cases where it actually,
er, functions, while giving something at least passable in the cases
that are broken today.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: max_parallel_degree > 0 for 9.6 beta
Next
From: Vladimir Sitnikov
Date:
Subject: Re: handling unconvertible error messages