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

From Victor Wagner
Subject Re: handling unconvertible error messages
Date
Msg-id 20160804180340.2881648f@fafnir.local.vm
Whole thread Raw
In response to Re: handling unconvertible error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: handling unconvertible error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, 04 Aug 2016 09:42:10 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Victor Wagner <vitus@wagner.pp.ru> writes:
> > If error occurs during processing of StartMessage protocol message,
> > i.e. client request connection to unexisting database,
> > ErrorResponse would contain message in the server default locale,
> > despite of client encoding being specified in the StartMessage.
>
> Yeah.  I'm inclined to think that we should reset the message locale
> to C as soon as we've forked away from the postmaster, and leave it
> that way until we've absorbed settings from the startup packet.
> Sending messages of this sort in English isn't great, but it's better
> than sending completely-unreadable ones.  Or is that just my
> English-centricity showing?

From my russian point of view, english messages are definitely better
than transliteration of Russian  with latin letters (although it is
not completely unreadable), not to mention wrong encoding or lots of
question marks.

Really, if this response is sent after backend has been forked, problem
probably can be easily fixed better way - StartupMessage contain
information about desired client encoding, so this information just
should be processed earlier than any other information from this
message, which can cause errors (such as database name).

If this errors are sent from postmaster itself, things are worse,
because I don't think that locale subsystem is desined to be
reintitalized lots of times in the same process.
But postmaster itself can use non-localized messaging. Its messages in
the logs are typically analyzed by more or less qualified DBA and
system admistrators, not by end user.






pgsql-hackers by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: New version numbering practices
Next
From: Alvaro Herrera
Date:
Subject: Re: regression test for extended query protocol