Re: BUG #15772: Some messages in log files are in ANSI encoding whileserver encoding is UTF8 - Mailing list pgsql-bugs

From Eugene Podshivalov
Subject Re: BUG #15772: Some messages in log files are in ANSI encoding whileserver encoding is UTF8
Date
Msg-id CAEPw1JWGtvPBkJ1e1yr_tV4aUZCyA5Wg88YMO3033oMY6FZzxA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15772: Some messages in log files are in ANSI encoding whileserver encoding is UTF8  (Eugene Podshivalov <yaugenka@gmail.com>)
List pgsql-bugs
Could it be the issue of not all messages taking lc_messages setting into account?
i.e. in my case all messeges should be in ANSI (Wndows-1251) instead of UTF-8.

Regards,
Eugene

чт, 18 апр. 2019 г. в 19:26, Eugene Podshivalov <yaugenka@gmail.com>:
I guess that the issue is related to this setting in the postgresql.conf file:
lc_messages = 'Russian_Russia.1251'                   # locale for system error message

I tried chaning it to 'en_US.UTF-8' and all new message in the log file are in English and look good regardless of whether I view it in UTF-8 or ANSI encoding.

I don't know what ANSI stands for either but it goes first in the list of encodings in notepad++ Encodings menu.
I guess it refers to Windows-1251 in my case.

The English variant of the messed up message in the UTF8 section of the screenshot above is
LOG:  database system was shut down at ...
LOG:  database system is ready to accept connections

All my databases have encoding=UTF8, collate=Russian_Russia.1251, ctype=Russian_Russia.1251

Regards,
Eugene

чт, 18 апр. 2019 г. в 19:20, Tom Lane <tgl@sss.pgh.pa.us>:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> I suppose you have databases with the single-byte encoding amidst your
> UTF8 ones.  AFAIK the log file registers the log entries in the same
> encoding that the database uses.  Different databases can use different
> encodings.

> That's pretty broken, but it's how it is.

Yeah, and it's not easy to improve on.  If we tried to convert all
log messages to the same encoding, which one would that be?
(Please, no nonsense about UTF8 being a universal solution.
The Japanese don't think so, for instance.)

Also, what do you do if you get an encoding conversion failure?

That's even before you get into implementation-dependent problems,
like what to do early in process startup before the encoding
conversion machinery is operational.

A more realistic idea might be to have separate log files for
different encodings, though that has a bunch of management issues
to solve as well.

                        regards, tom lane

pgsql-bugs by date:

Previous
From: Eugene Podshivalov
Date:
Subject: Re: BUG #15772: Some messages in log files are in ANSI encoding whileserver encoding is UTF8
Next
From: Sandeep Thakkar
Date:
Subject: Re: Re: BUG #15769: The database cluster intialisation failed.