Re: BUG #4186: set lc_messages does not work - Mailing list pgsql-bugs

From Euler Taveira de Oliveira
Subject Re: BUG #4186: set lc_messages does not work
Date
Msg-id 48364EBD.7080402@timbira.com
Whole thread Raw
In response to Re: BUG #4186: set lc_messages does not work  ("Thomas H." <me@alternize.com>)
Responses Re: BUG #4186: set lc_messages does not work  ("Thomas H." <me@alternize.com>)
List pgsql-bugs
Thomas H. wrote:

> please observe the (previously already submitted) test queries. i've
> removed the date/time testqueries to no further distract from the
> problem. the bogus query "select x;" always results in a german error
> messages no matter what LC_MESSAGES is set:
>
OK, that's another problem. AFAIK, that's a known problem because
Windows doesn't have LC_MESSAGES. The above comment (pg_locale.c)
suggests that there is no verification for the locale that is been set.
A possible solution is to use IsValidLocaleName() [1] or
LocaleNameToLCID() [2] but it seems that they're only available for
Vista. :( Maybe we could emulate one of these functions with a mapping
table [3]. [searching ...] It seems there are problems with LCIDs; they
don't describe the locales acurately. pgwin hackers?
Could you try to use one of the locale names described in [4]?

/*
  * LC_MESSAGES category does not exist everywhere, but accept it anyway
  *
  * On Windows, we can't even check the value, so the non-doit case is a
  * no-op
  */

[1] http://msdn.microsoft.com/en-us/library/ms776379(VS.85).aspx
[2] http://msdn.microsoft.com/en-us/library/ms776388(VS.85).aspx
[3] http://msdn.microsoft.com/en-us/library/ms776260.aspx


--
   Euler Taveira de Oliveira
   http://www.timbira.com/

pgsql-bugs by date:

Previous
From: "Thomas H."
Date:
Subject: Re: BUG #4186: set lc_messages does not work
Next
From: "TIAN Justin"
Date:
Subject: Re: error message "psql: expected authentication request from server, but received " when using psql to connect remote database