Configuring messages language on Windows

From: a(dot)parfenov(at)postgrespro(dot)ru
To: pgsql-hackers(at)postgresql(dot)org
Subject: Configuring messages language on Windows
Date: 2018-01-26 13:54:08
Message-ID: 20180126165408.00e59c6e@asp437-24-g082ur
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hello hackers,

As it mentioned in pg_locale.c, the variable LC_MESSAGES is ignored in
Windows(pg_locale.c:162). In other systems, this variable is
used to select a messages language. But in Windows, the language is
selected based on system locale and couldn't be changed via
configuration. Additionally, this affects regress tests, since language
for messages generated by psql is also configured via LC_MESSAGES and
ignored on Windows installations and cause failure of tests on
non-English Windows installations.

I've done a little patch to fix that problem via usage of LANGUAGE
variable on Windows systems. To get more information about LC_MESSAGES,
LANGUAGE and other variable used in GNU gettext look at documentation
[1].
IMHO that patch is more like a workaround and I'm not sure that it is
safe for all combination of systems/compilers. I think we can find a
better way to solve the problem.

Also, there is a problem of mixing encoding in the log in case of
databases with different encoding on one server. I didn't find any good
solution how to work in such a case because each backend should use its
own encoding in order to work with data and client properly. This
problem is not Windows specific, but most of the OS use one Unicode
encoding for all languages (e.g. UTF-8).

The main point of this message is to say about the problem, try to
find an appropriate solution and ask community's opinion about the
problem.

[1]
https://www.gnu.org/software/gettext/manual/html_node/Locale-Environment-Variables.html

Attachment Content-Type Size
windows-messages-language-bugfix.patch text/x-diff 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2018-01-26 13:56:01 Re: Setting BLCKSZ 4kB
Previous Message Robert Haas 2018-01-26 13:29:26 Re: [HACKERS][PATCH] Applying PMDK to WAL operations for persistent memory