Re: PG compilation error with Visual Studio 2015/2017/2019

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, davinder singh <davindersingh2692(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PG compilation error with Visual Studio 2015/2017/2019
Date: 2020-04-23 12:07:09
Message-ID: CAC+AXB06EBrTcD1a4O1GFfAYmMvrsvY4jQPS63LznahxLi-qxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 23, 2020 at 5:30 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:

>
> Okay, I hope we will see better comments in the next version.
>

I have focused on improving comments in this version.

> Hmm, if you really want to log the value then do it in the caller. I
> don't think making special arrangements just for logging this value is
> a good idea.
>

Agreed.

> I think we can check with simple error messages. So, basically after
> setting a particular value of LC_MESSAGES, execute a query which
> returns syntax or any other error, if the error message is the same
> irrespective of the locale name returned by _create_locale and
> GetLocaleInfoEx, then we should be fine. I want to especially try
> where the return value is slightly different by _create_locale and
> GetLocaleInfoEx. I know Davinder is trying something like this but
> if you can also try then it would be good.
>

I have composed a small set of queries to test the output with
different lc_message settings (lc_messages_test.sql). Please find attached
the output from debug3 logging using both EnumSystemLocalesEx
(lc_messages_EnumSystemLocalesEx.log) and _create_locale
(lc_messages_create_locale.log).

> In Windows wchar_t is 2 bytes, so we would have to do make UTF16 to
> UFT32 conversions back and forth. Not sure if it is worth the effort.
>
> Yeah, I am also not sure about this. So, let us see if anyone else
> has any thoughts on this point, otherwise, we can go with wchar
> functions as you have in the patch.
>

Ok, the attached version still uses that approach.

Regards,

Juan José Santamaría Flecha

Attachment Content-Type Size
0001-PG-compilation-error-with-VS-2015-2017-2019_v13.patch application/octet-stream 6.9 KB
lc_messages_create_locale.log application/octet-stream 3.6 KB
lc_messages_EnumSystemLocalesEx.log application/octet-stream 3.6 KB
lc_messages_test.sql application/octet-stream 1.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2020-04-23 12:09:22 Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators
Previous Message Stephen Frost 2020-04-23 11:31:55 Re: Logical replication subscription owner