Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: "Haifang Wang (Centific Technologies Inc)" <v-haiwang(at)microsoft(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Date: 2024-05-13 22:47:23
Message-ID: CA+hUKG+GUcSzk7UwvuLr4p84BQV8k2xvVAjToW=fQ5rCrciJ4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, May 14, 2024 at 10:27 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang(at)microsoft(dot)com> wrote:
> Thanks for your reply. But I'm not sure if there is any miscommunication. Let me make it clear again.

(Sorry, it seems our emails crossed.)

> I’m a program manager in the Windows App Assure ISV Outreach Team at Microsoft. We work with Microsoft’s test organization to notify developers when issues have been identified in their applications. The issue I reported in this mail is an issue we found in our testing and I believe it also impact a lot of end users. Like you mentioned previously, it is caused by recent operating system upgrade.

Thanks for doing that, and yes, it affects a lot of users, and this is
not the first time. It is still possible for it to be the last...

> The solution I shared in my last email was suggested our engineers. It would be great is you could use _wsetlocale API. this is what the recommended way as par Microsoft documentation as well. (Reference: setlocale wsetlocale: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-170

I don't understand. Can you explain why _wsetlocale() is better than
setlocale()? They behave identically except one takes wide
characters, which doesn't seem to solve any problem we have.

> If you don’t want to change the API to update their mapping table with Turkish_Tur in case of Turkish_Türkiye as you have done for others locale with same issue as well in your code (reference PostgreSQL Source Code: src/port/win32setlocale.c Source File: https://doxygen.postgresql.org/win32setlocale_8c_source.html, Line number 66-67).

Yeah, OK we could put more kludges into win32setlocale.c. I don't
mind committing a patch like that if it addresses the issue. I am not
in a position to confirm that myself... what we need is someone who
works with Windows to write the patch and test it across that upgrade.
Longer term I'm looking for something better than that though, because
it doesn't address the root cause (need for stable identifiers), and
will only ever allow us to fix problems with the old unstable names
*after* users complain that their database is dead, 3-6 months after
in fact due to release cycles. I think a dynamic mapping file might
be better? (Maybe win32locale.c should be able to read that kludge
table from a file that you can give it with an environment variable,
or something like that?)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-05-13 23:07:18 Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Previous Message Haifang Wang (Centific Technologies Inc) 2024-05-13 22:27:32 RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607