pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedWindows Application Issues | PostgreSQL | REF # 48475607
73+ messages / 10 participants
[nested] [flat]
Commits from this thread:
2024-10-05 adbb27ac89 9c7acc3330 ce17de580f Reject non-ASCII locale names.
* Windows Application Issues | PostgreSQL | REF # 48475607
@ 2024-05-02 17:26 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-02 17:26 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
I'm sorry to bother you if you are not the right person. In that case, could you please help to point me in the right direction for the right contact? Thanks a lot!
Hi Team,
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. We're reaching out to notify you of a potential issue in one of your applications.
The issue details are below, please review it when you have a moment. Our goal is to work with you to address this issue and to understand what your expected timeline to address this issue might be. If you have any questions about the details below or have already addressed this issue in a forthcoming update, please let me know.
Account
PostgreSQL Global Development Group
Product
PostgreSQL
Reference #
48475607
Issue
Postgres.exe crash observed while installing the application.
Environment: Desktop
OS: Windows 11
App Version: 16.1
Repro Steps:
1. Deploy windows server 2019 Turkey Build.
2. Patch the machine till WU and enable roles & feature in server manager.
3. Restart the machine to configure updates & observe winver 17763.5329
4. Login as Administrator.
5. Download and install the application: https://www.postgresql.org/download/
6. Click on Setup and in setup launched click on next.
7. Click next on installation directory window.
8. In Select components window make sure all are selected .and click on next .
9. In data directory window click on next.
10. In Password window provide the password and click on next.
11. In port window click on next .
12. Click on next default in advanced settings ,summary & ready to install window.
13. While the application is installing ,
14. Observe..
Observations:
Postgres.exe crash is observed while installing the application.
Expected Results:
Should not observe any crash while installing the application
Resource
For any questions on app development (or) submission on windows, contact Windows Dev Center. https://developer.microsoft.com/en-us/windows/support
Thanks!
Haifang
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-05-02 23:50 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-02 23:53 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 2 replies; 73+ messages in thread
From: Thomas Munro @ 2024-05-02 23:50 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Fri, May 3, 2024 at 7:05 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Deploy windows server 2019 Turkey Build.
...
> Postgres.exe crash is observed while installing the application.
Hi,
"Crash" with no details is not a very useful report, but I guess that
this is the Turkey -> Türkiye issue caused by a recent operating
system upgrade, which is apparently now hitting the server edition of
Windows based on the new inflow of bug reports. I think we know
approximately how to fix it, and there are several possible
workarounds for a system that is already in this state, but interested
parties who know and care about the relevant OS need to get involved
to make progress. It's too late for Turkish but ideally we'll be able
to stop this from happening the next time a country changes its name.
I have written everything I know about the issue here:
https://www.postgresql.org/message-id/flat/18196-b10f93dfbde3d7db%40postgresql.org
Not being a Windows user, I have not been able to take that proposed
fix all the way to the finish line, so all I can do is post what I
know and hope that open source will happen.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-05-02 23:53 ` Thomas Munro <thomas.munro@gmail.com>
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Munro @ 2024-05-02 23:53 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Fri, May 3, 2024 at 11:50 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> https://www.postgresql.org/message-id/flat/18196-b10f93dfbde3d7db%40postgresql.org
And more here:
https://www.postgresql.org/message-id/flat/CA+hUKGJ=XThErgAQRoqfCy1bKPxXVuF0=2zDbB+SxDs59pv7Fw@mail....
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-05-13 18:51 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 21:50 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
1 sibling, 2 replies; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-13 18:51 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Hi Thomas,
Thanks a lot for your previous reply. Still need to double check with you:
You said the Turkey -> Türkiye issue caused by a recent operating system upgrade, you mean this crash is caused by the changes made on Windows side? If that is the case, you prefer to leave the bug there? Any plan for the future?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Thursday, May 2, 2024 4:51 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
[You don't often get email from thomas.munro@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
On Fri, May 3, 2024 at 7:05 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Deploy windows server 2019 Turkey Build.
...
> Postgres.exe crash is observed while installing the application.
Hi,
"Crash" with no details is not a very useful report, but I guess that this is the Turkey -> Türkiye issue caused by a recent operating system upgrade, which is apparently now hitting the server edition of Windows based on the new inflow of bug reports. I think we know approximately how to fix it, and there are several possible workarounds for a system that is already in this state, but interested parties who know and care about the relevant OS need to get involved to make progress. It's too late for Turkish but ideally we'll be able to stop this from happening the next time a country changes its name.
I have written everything I know about the issue here:
https://www.postgresql.org/message-id/flat/18196-b10f93dfbde3d7db%40postgresql.org
Not being a Windows user, I have not been able to take that proposed fix all the way to the finish line, so all I can do is post what I know and hope that open source will happen.
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-05-13 21:50 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
1 sibling, 0 replies; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-13 21:50 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Hi Thomas and team,
Some suggestion from our engineers, please take a look and let me know if you have any question:
1. Could you please use _wsetlocale API in case of wide string locale parameter, this is what the recommended way as par Microsoft documentation as well. (Reference: setlocale: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-170, wsetlocale: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-170)
2. Additionally you can work around in case 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)
Please let me know if there is any other questions.
Regards!
Haifang
-----Original Message-----
From: Haifang Wang (Centific Technologies Inc)
Sent: Monday, May 13, 2024 11:52 AM
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi Thomas,
Thanks a lot for your previous reply. Still need to double check with you:
You said the Turkey -> Türkiye issue caused by a recent operating system upgrade, you mean this crash is caused by the changes made on Windows side? If that is the case, you prefer to leave the bug there? Any plan for the future?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <mailto:thomas.munro@gmail.com>
Sent: Thursday, May 2, 2024 4:51 PM
To: Haifang Wang (Centific Technologies Inc) <mailto:v-haiwang@microsoft.com>
Cc: mailto:pgsql-bugs@lists.postgresql.org
Subject: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
[You don't often get email from mailto:thomas.munro@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
On Fri, May 3, 2024 at 7:05 AM Haifang Wang (Centific Technologies
Inc) <mailto:v-haiwang@microsoft.com> wrote:
> Deploy windows server 2019 Turkey Build.
...
> Postgres.exe crash is observed while installing the application.
Hi,
"Crash" with no details is not a very useful report, but I guess that this is the Turkey -> Türkiye issue caused by a recent operating system upgrade, which is apparently now hitting the server edition of Windows based on the new inflow of bug reports. I think we know approximately how to fix it, and there are several possible workarounds for a system that is already in this state, but interested parties who know and care about the relevant OS need to get involved to make progress. It's too late for Turkish but ideally we'll be able to stop this from happening the next time a country changes its name.
I have written everything I know about the issue here:
https://www.postgresql.org/message-id/flat/18196-b10f93dfbde3d7db%40postgresql.org
Not being a Windows user, I have not been able to take that proposed fix all the way to the finish line, so all I can do is post what I know and hope that open source will happen.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-05-13 22:11 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
1 sibling, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-05-13 22:11 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Tue, May 14, 2024 at 6:51 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> You said the Turkey -> Türkiye issue caused by a recent operating system upgrade, you mean this crash is caused by the changes made on Windows side? If that is the case, you prefer to leave the bug there? Any plan for the future?
First, let me restate the problem:
When you create a database cluster (= a PostgreSQL instance) with
"initdb", unless you request a default locale with --locale, initdb
uses setlocale("") to query the system/user default locale. It then
records that string in postgresql.conf, and also in the pg_database
catalog. On POSIX systems, that captures something like "tr-TR.UTF-8"
or similar. On Windows, that captures something like
"Turkish_Turkey.1254". Later, PostgreSQL uses newlocale() or
setlocale() functions to access that locale again. In rare cases
where a country changes its name, a Windows update *renames* the
locale, and then those calls fail, because the old name is not
recognised anymore.
I proposed a partial solution that should help avoid the problem in future:
I think that initdb should instead call GetUserDefaultLocaleName() to
discover the user account's default locale, because it returns BCP47
names like "tr-TR". It is probably less likely for a country or
language to change its ISO code (but not impossible[1]), than for the
English-language names of them to change. Even if you reject this
idea because technically they can both change, there are other reasons
why we should not be storing this "display"-style names anywhere,
including that PostgreSQL needs to store them in a place where the
encoding must be ASCII, which Türkiye is not. And finally, the
Windows manual explicitly warns us about this[2]: "We don't recommend
this form for locale strings embedded in code or serialized to
storage: These strings are more likely to be changed by an operating
system update than the locale name form."
(Note: the BCP47 support in Windows did not exist when that PostgreSQL
code was written, so it did what it had to at the time.)
There are further problems to resolve:
1. We don't know if we should put encodings (AKA codepages?) on the
end of those strings or not. There is some confusion about what
exactly it does, and how it interacts with the "ACP". I'd be worried
that if you don't put the endings on, perhaps it can change under your
feet. (I suspect that part of the discussion on that other thread
took some wrong turns, based on citext_utf8 results that were actually
probably misleading.)
2. If we do decide to put the encoding suffixes on, which encoding
should we be suggesting? It appears from anecdotal reports that most
PostgreSQL-on-Windows users are stuck in the past, using the old
pre-UTF-8 language-specific encodings. Should we be encouraging UTF-8
use by default, if we can? Maybe that is a separate question.
Then there is the practical question of what to do with an
already-broken system. One idea would be to introduce a "locale
remapping" file, pgdata/pg_locale.map where you can write things
like "Turkish_Turkey.1254"="Turkish_Türkiye.1254".
I think there might be a GUI tool that allows you to duplicate,
rename, etc locales in Windows, so you can re-create the old name. I
believe that is how some people have fixed their broken databases. I
don't know if there is a good reference/blog/article on that, that we
should be pointing people towards if they show up with broken systems.
Patches, testing, research are welcome! Even though I put forward that
BCP47 idea, it was based on reading the manual, so the "unresolved"
questions may in fact be very easy to resolve by people who actually
use/know Windows. Even if I had been gung-ho about committing
that in 16 without feedback from Windows users, it would have been too
late to help Turkish users with existing databases.
[1] https://learn.microsoft.com/en-us/globalization/locale/standard-locale-names
[2] https://learn.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-st...
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-05-13 22:27 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-13 22:27 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Hi Thomas,
Thanks for your reply. But I'm not sure if there is any miscommunication. Let me make it clear again.
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.
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
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).
Please let me know if there is any misunderstanding.
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, May 13, 2024 3:12 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, May 14, 2024 at 6:51 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> You said the Turkey -> Türkiye issue caused by a recent operating system upgrade, you mean this crash is caused by the changes made on Windows side? If that is the case, you prefer to leave the bug there? Any plan for the future?
First, let me restate the problem:
When you create a database cluster (= a PostgreSQL instance) with "initdb", unless you request a default locale with --locale, initdb uses setlocale("") to query the system/user default locale. It then records that string in postgresql.conf, and also in the pg_database catalog. On POSIX systems, that captures something like "tr-TR.UTF-8"
or similar. On Windows, that captures something like "Turkish_Turkey.1254". Later, PostgreSQL uses newlocale() or
setlocale() functions to access that locale again. In rare cases where a country changes its name, a Windows update *renames* the locale, and then those calls fail, because the old name is not recognised anymore.
I proposed a partial solution that should help avoid the problem in future:
I think that initdb should instead call GetUserDefaultLocaleName() to discover the user account's default locale, because it returns BCP47 names like "tr-TR". It is probably less likely for a country or language to change its ISO code (but not impossible[1]), than for the English-language names of them to change. Even if you reject this idea because technically they can both change, there are other reasons why we should not be storing this "display"-style names anywhere, including that PostgreSQL needs to store them in a place where the encoding must be ASCII, which Türkiye is not. And finally, the Windows manual explicitly warns us about this[2]: "We don't recommend this form for locale strings embedded in code or serialized to
storage: These strings are more likely to be changed by an operating system update than the locale name form."
(Note: the BCP47 support in Windows did not exist when that PostgreSQL code was written, so it did what it had to at the time.)
There are further problems to resolve:
1. We don't know if we should put encodings (AKA codepages?) on the end of those strings or not. There is some confusion about what exactly it does, and how it interacts with the "ACP". I'd be worried that if you don't put the endings on, perhaps it can change under your feet. (I suspect that part of the discussion on that other thread took some wrong turns, based on citext_utf8 results that were actually probably misleading.) 2. If we do decide to put the encoding suffixes on, which encoding should we be suggesting? It appears from anecdotal reports that most PostgreSQL-on-Windows users are stuck in the past, using the old
pre-UTF-8 language-specific encodings. Should we be encouraging UTF-8 use by default, if we can? Maybe that is a separate question.
Then there is the practical question of what to do with an already-broken system. One idea would be to introduce a "locale remapping" file, pgdata/pg_locale.map where you can write things like "Turkish_Turkey.1254"="Turkish_Türkiye.1254".
I think there might be a GUI tool that allows you to duplicate, rename, etc locales in Windows, so you can re-create the old name. I believe that is how some people have fixed their broken databases. I don't know if there is a good reference/blog/article on that, that we should be pointing people towards if they show up with broken systems.
Patches, testing, research are welcome! Even though I put forward that
BCP47 idea, it was based on reading the manual, so the "unresolved"
questions may in fact be very easy to resolve by people who actually use/know Windows. Even if I had been gung-ho about committing that in 16 without feedback from Windows users, it would have been too late to help Turkish users with existing databases.
[1] https://learn.microsoft.com/en-us/globalization/locale/standard-locale-names
[2] https://learn.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-st...
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-05-13 22:47 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-05-13 22:47 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Tue, May 14, 2024 at 10:27 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.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?)
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-05-13 23:07 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-05-13 23:09 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 John McKown <john.archie.mckown@gmail.com>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 2 replies; 73+ messages in thread
From: Tom Lane @ 2024-05-13 23:07 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Thomas Munro <thomas.munro@gmail.com> writes:
> 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?)
+1 for the long-term solution being more-stable locale identifiers.
However, we should try to build something that will let users get
out of these situations with the existing identifiers, so I like
your idea of a plain-text mapping file for Windows locale names.
I don't think an environment variable is necessary; just define
a fixed name "$PGDATA/locale_map.txt" or such. If that file
exists, just read it and map the pg_database field values with it.
Maybe this shouldn't even be Windows-specific? Are there any
cases where it'd save people's bacon on other platforms?
regards, tom lane
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
@ 2024-05-13 23:09 ` John McKown <john.archie.mckown@gmail.com>
2024-05-13 23:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 73+ messages in thread
From: John McKown @ 2024-05-13 23:09 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Munro <thomas.munro@gmail.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; pgsql-bugs@lists.postgresql.org
Just curious. Why a plain text file rather than a system table?
On Mon, May 13, 2024, 18:07 Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@gmail.com> writes:
> > 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?)
>
> +1 for the long-term solution being more-stable locale identifiers.
> However, we should try to build something that will let users get
> out of these situations with the existing identifiers, so I like
> your idea of a plain-text mapping file for Windows locale names.
> I don't think an environment variable is necessary; just define
> a fixed name "$PGDATA/locale_map.txt" or such. If that file
> exists, just read it and map the pg_database field values with it.
>
> Maybe this shouldn't even be Windows-specific? Are there any
> cases where it'd save people's bacon on other platforms?
>
> regards, tom lane
>
>
>
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-13 23:09 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 John McKown <john.archie.mckown@gmail.com>
@ 2024-05-13 23:15 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 73+ messages in thread
From: Tom Lane @ 2024-05-13 23:15 UTC (permalink / raw)
To: John McKown <john.archie.mckown@gmail.com>; +Cc: Thomas Munro <thomas.munro@gmail.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; pgsql-bugs@lists.postgresql.org
John McKown <john.archie.mckown@gmail.com> writes:
> Just curious. Why a plain text file rather than a system table?
Because you'd have no way to update such a table, if you can't
start the database or connect to it. So that approach isn't
suitable for people whose database has been broken by one of
these system updates. (This is largely the same reason why,
eg, postgresql.conf isn't a table.)
regards, tom lane
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
@ 2024-05-14 06:38 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
1 sibling, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-05-14 06:38 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Tue, May 14, 2024 at 11:07 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> +1 for the long-term solution being more-stable locale identifiers.
> However, we should try to build something that will let users get
> out of these situations with the existing identifiers, so I like
> your idea of a plain-text mapping file for Windows locale names.
> I don't think an environment variable is necessary; just define
> a fixed name "$PGDATA/locale_map.txt" or such. If that file
> exists, just read it and map the pg_database field values with it.
OK, I tried that, first draft attached (with my standard proviso that
I don't do Windows, I just know that this passes CI and that the code
works the way I intended on my local Unix system if extracted into a
little harness). With this, you could in theory create a file
PGDATA/win32setlocale.map containing:
c Turkish_Turkey.1254=Turkish_Türkiye.1254
... or perhaps more likely:
c Turkish_Turkey.1254=tr-TR.1254
I also absorbed the pre-existing kludge table into the new system by
default (though they got a bit shorter 'cause I invented some
wildcards). Some problems came up while wondering how to fit Türkiye
into the defaults, and how to back-patch:
1. In the back-branches, we claim to support ancient Windows releases
as far back as "Windows 2000 SP4" (!), which obviously aren't getting
the Windows updates, so I guess "Turkish_Türkiye.1254" will fail there
and generally before Windows 10. And even if you exclude the
extremities of our support window somehow (how?), modern systems might
not have applied the update yet (IIUC they *have* to at some point
under the new world order, so there is a defined window of version
skew these days).
2. It's generally a terrible idea to be using "ü" in a locale name.
FWIW I assume setlocale() actually accepts and returns names encoded
in the current ACP ("active codepage", system-wide changeable setting
that controls char↔wchar_t conversion in system APIs), so the encoding
of that file (and the built-in default table) would need to match that
to work, as coded. Perhaps it would be possible to make the mapping
file UTF-8 and transform that to ACP! But it feels a bit too loopy
for me, and on the PostgreSQL side it is undefined/illegal whatever
you choose in PostgreSQL due to being accessed from different
databases which are using potentially different encodings that are
only required to be a superset of ASCII. Avoid.
3. Therefore you'd probably want to prefer "tr-TR.1254" as the
replacement string. But what is the oldest Windows release that can
understand a BCP47 code like that?
4. Conversely, on modern systems, I'm still not entirely sure that
"tr-TR.1254" is exactly the same thing as "Turkish-XXX.1254" and that
it's OK to put ".1254" on the end like that. Is it, and is it? I
don't mean just "does it mean Turkish?", I mean "does it give exactly
the same answer for every conceivable pair of strings when compared
with strcoll_l(), and likewise for the ctype-based functions like
towlower() et al".
If the answers are not in our favour, I guess we could leave the
default behaviour unchanged, and let people set up a text file as
shown above to fix their database if they want, but that's also not
very nice and kinda weird (helping hypothetical users of museum-grade
systems by leaving real users' systems broken).
If the answer to 4 is yes, yes then we could also push ahead with the
plan to make initdb pick BCP47 names by default in PG18 (or even 17).
> Maybe this shouldn't even be Windows-specific? Are there any
> cases where it'd save people's bacon on other platforms?
Good question. Sometimes ISO code go away or countries split etc, so
it's no like POSIX locale names are set in stone under all
circumstances. But on Unixen it's all just files in practice, you can
always just symlink them, move them around, compile them yourself from
sources, etc, if you really have to, so I think I'd rather contain the
crazy in win32*.c.
Attachments:
v1-0001-Make-win32locale.c-s-kludge-table-dynamic.patch (text/x-patch, 15.0K) download
From beba97b53fa9fc6d302fc84acaca2b267c991625 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Tue, 14 May 2024 16:46:27 +1200
Subject: [PATCH v1] Make win32locale.c's kludge table dynamic.
Historically, we transformed Windows' locale names on entry to and exit
from setlocale(), because they are unstable and we can't really handle
non-ASCII locale names. We shouldn't be using these unstable display
names, but *setlocale() itself* gave them to us, and it can't even
understand everything it returns, leading to a series of historical
kludges.
Ideally we should soon switch to BCP47 codes for new clusters, but we'll
have to support the older names in ancient database clusters for now and
deal with the transition.
So, provide users with an emergency option for getting unstuck, since
they probably don't want to wait 3-6 months for a new binary with an
updated kludge table when their database fails to come up. While there
are probably workarounds within Windows tools, it seems easy enough to
offer a textfile of name mappings. It might also have applications in
the transition to BCP47.
Discussion: https://postgr.es/m/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.namprd21.prod.outlook.com
---
src/port/win32setlocale.c | 415 ++++++++++++++++++++++++-------
src/tools/pgindent/typedefs.list | 1 +
2 files changed, 332 insertions(+), 84 deletions(-)
diff --git a/src/port/win32setlocale.c b/src/port/win32setlocale.c
index 9e2ab8cc3ad..ee580311487 100644
--- a/src/port/win32setlocale.c
+++ b/src/port/win32setlocale.c
@@ -36,25 +36,36 @@
#undef setlocale
-struct locale_map
-{
- /*
- * String in locale name to replace. Can be a single string (end is NULL),
- * or separate start and end strings. If two strings are given, the locale
- * name must contain both of them, and everything between them is
- * replaced. This is used for a poor-man's regexp search, allowing
- * replacement of "start.*end".
- */
- const char *locale_name_start;
- const char *locale_name_end;
-
- const char *replacement; /* string to replace the match with */
-};
-
/*
- * Mappings applied before calling setlocale(), to the argument.
+ * The path of a text file that can be created under PGDATA to override these
+ * rules. It allows locale names to be overridden on input to setlocale, and
+ * on return from setlocale when querying the default. This is intended as an
+ * option of last resort for users whose system becomes unstartable due to an
+ * operating system update that changes a locale name.
+ *
+ * # comments begin a hash sign
+ * call pattern=replacement
+ * return pattern=replacemnt
+ *
+ * The pattern syntax supports ? for any character (really byte), and * for
+ * any sequence, though only one star can be used in the whole pattern.
+ *
+ * The encoding of the file is effectively undefined; setlocale() works with
+ * the current Windows ACP, and PostgreSQL thinks the strings should be ASCII
+ * or some undefined superset. This could lead to some confusion if databases
+ * have different encodings, so it's likely that replacements should use BCP47
+ * tags if possible.
*/
-static const struct locale_map locale_map_argument[] = {
+#define LOCALE_MAP_PATH "win32setlocale.map"
+
+typedef struct Win32LocaleTableEntry
+{
+ char direction;
+ const char *pattern;
+ const char *replacement;
+} Win32LocaleTableEntry;
+
+static const Win32LocaleTableEntry default_mapping_table[] = {
/*
* "HKG" is listed here:
* http://msdn.microsoft.com/en-us/library/cdax410z%28v=vs.71%29.aspx
@@ -63,8 +74,8 @@ static const struct locale_map locale_map_argument[] = {
* "ARE" is the ISO-3166 three-letter code for U.A.E. It is not on the
* above list, but seems to work anyway.
*/
- {"Hong Kong S.A.R.", NULL, "HKG"},
- {"U.A.E.", NULL, "ARE"},
+ {'c', "Hong Kong S.A.R.", "HKG"},
+ {'c', "U.A.E.", "ARE"},
/*
* The ISO-3166 country code for Macau S.A.R. is MAC, but Windows doesn't
@@ -79,17 +90,9 @@ static const struct locale_map locale_map_argument[] = {
*
* Some versions of Windows spell it "Macau", others "Macao".
*/
- {"Chinese (Traditional)_Macau S.A.R..950", NULL, "ZHM"},
- {"Chinese_Macau S.A.R..950", NULL, "ZHM"},
- {"Chinese (Traditional)_Macao S.A.R..950", NULL, "ZHM"},
- {"Chinese_Macao S.A.R..950", NULL, "ZHM"},
- {NULL, NULL, NULL}
-};
+ {'c', "Chinese (Traditional)_Maca? S.A.R..950", "ZHM"},
+ {'c', "Chinese_Maca? S.A.R..950", "ZHM"},
-/*
- * Mappings applied after calling setlocale(), to its return value.
- */
-static const struct locale_map locale_map_result[] = {
/*
* "Norwegian (Bokmål)" locale name contains the a-ring character.
* Map it to a pure-ASCII alias.
@@ -100,84 +103,324 @@ static const struct locale_map locale_map_result[] = {
* Just to make life even more complicated, some versions of Windows spell
* the locale name without parentheses. Translate that too.
*/
- {"Norwegian (Bokm", "l)_Norway", "Norwegian_Norway"},
- {"Norwegian Bokm", "l_Norway", "Norwegian_Norway"},
- {NULL, NULL, NULL}
+ {'r', "Norwegian (Bokm*l)_Norway", "Norwegian_Norway"},
+ {'r', "Norwegian Bokm*l_Norway", "Norwegian_Norway"},
};
-#define MAX_LOCALE_NAME_LEN 100
+static bool mapping_table_initialized;
+static const Win32LocaleTableEntry *mapping_table;
+static size_t mapping_table_size;
-static const char *
-map_locale(const struct locale_map *map, const char *locale)
+/*
+ * Parse a line of the mapping file. Returns 0 on success. Squawks to stderr
+ * on failure, but also sets the errno for setlocale() to fail with and
+ * returns -1 in that case.
+ */
+static int
+parse_line(char *line,
+ int line_number,
+ char *direction,
+ char **pattern,
+ char **replacement)
+{
+ const char *rest = NULL;
+ const char *delimiter;
+ size_t len;
+
+ /* Strip line endings. */
+ while ((len = strlen(line)) > 0 &&
+ (line[len - 1] == '\r' || line[len - 1] == '\n'))
+ line[len - 1] = '\0';
+
+ /* Skip empty lines and shell-style comments. */
+ if (line[0] == '\0' || line[0] == '#')
+ {
+ *direction = '\0';
+ return 0;
+ }
+
+ /* Is it "call ..." or "return ..."? */
+ if (strncmp(line, "call ", 5) == 0)
+ rest = line + 5;
+ else if (strncmp(line, "return ", 7) == 0)
+ rest = line + 7;
+ if (!rest)
+ {
+ fprintf(stderr,
+ "syntax error on line %d of " LOCALE_MAP_PATH "\n",
+ line_number);
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Grab 'c' or 'r'. */
+ *direction = line[0];
+
+ /* Look for the equal sign followed by something. */
+ delimiter = strchr(rest, '=');
+ if (!delimiter || delimiter[1] == '\0')
+ {
+ fprintf(stderr,
+ "syntax error on line %d of " LOCALE_MAP_PATH ", expected '='\n",
+ line_number);
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Copy the pattern. */
+ len = delimiter - rest;
+ *pattern = malloc(len + 1);
+ if (!*pattern)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(*pattern, rest, len);
+ (*pattern)[len] = '\0';
+
+ /* Copy the replacement. */
+ *replacement = strdup(delimiter + 1);
+ if (!*replacement)
+ {
+ free(*pattern);
+ errno = ENOMEM;
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * Free a mapping table. Only used for cleanup on failure, because otherwise
+ * the mapping table is built once and sticks around until process exit.
+ */
+static void
+free_mapping_table(Win32LocaleTableEntry *table, size_t size)
{
- static char aliasbuf[MAX_LOCALE_NAME_LEN];
- int i;
+ for (size_t i = 0; i < size; ++i)
+ {
+ free(unconstify(char *, table[i].pattern));
+ free(unconstify(char *, table[i].replacement));
+ }
+ free(table);
+}
+
+static void
+initialize_default_mapping_table(void)
+{
+ mapping_table = default_mapping_table;
+ mapping_table_size = lengthof(default_mapping_table);
+}
+
+/*
+ * Initialize mapping_table and mapping_table_size. Returns 0 on success, or
+ * -1 for failure.
+ */
+static int
+initialize_mapping_table(void)
+{
+ FILE *file;
+ char path[MAXPGPATH];
+ const char *pgdata;
+ char line[128];
+ int line_number;
+ Win32LocaleTableEntry *table;
+ size_t table_size;
+ size_t table_capacity;
+
+ /* If there is no PGDATA, we're probably not in a backend so do nothing. */
+ pgdata = getenv("PGDATA");
+ if (!pgdata)
+ {
+ initialize_default_mapping_table();
+ return 0;
+ }
- /* Check if the locale name matches any of the problematic ones. */
- for (i = 0; map[i].locale_name_start != NULL; i++)
+ /* If there is no mapping file, do nothing. */
+ snprintf(path, sizeof(path), "%s/%s", pgdata, LOCALE_MAP_PATH);
+ file = fopen(path, "r");
+ if (!file)
{
- const char *needle_start = map[i].locale_name_start;
- const char *needle_end = map[i].locale_name_end;
- const char *replacement = map[i].replacement;
- char *match;
- char *match_start = NULL;
- char *match_end = NULL;
-
- match = strstr(locale, needle_start);
- if (match)
+ initialize_default_mapping_table();
+ return 0;
+ }
+
+ /* Initial guess at required space. */
+ table_size = 0;
+ table_capacity = 16;
+ table = malloc(sizeof(Win32LocaleTableEntry) * table_capacity);
+ if (table == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+
+ /* Read the file line-by-line. */
+ while (fgets(line, sizeof(line), file))
+ {
+ char direction;
+ char *pattern;
+ char *replacement;
+
+ if (parse_line(line,
+ line_number++,
+ &direction,
+ &pattern,
+ &replacement) != 0)
{
- /*
- * Found a match for the first part. If this was a two-part
- * replacement, find the second part.
- */
- match_start = match;
- if (needle_end)
- {
- match = strstr(match_start + strlen(needle_start), needle_end);
- if (match)
- match_end = match + strlen(needle_end);
- else
- match_start = NULL;
- }
- else
- match_end = match_start + strlen(needle_start);
+ /* errno already set */
+ free_mapping_table(table, table_size);
+ fclose(file);
+ return -1;
}
- if (match_start)
+ /* Skip blank/comments. */
+ if (direction == '\0')
+ continue;
+
+ /* Grow by doubling on demand. */
+ if (table_size == table_capacity)
{
- /* Found a match. Replace the matched string. */
- int matchpos = match_start - locale;
- int replacementlen = strlen(replacement);
- char *rest = match_end;
- int restlen = strlen(rest);
-
- /* check that the result fits in the static buffer */
- if (matchpos + replacementlen + restlen + 1 > MAX_LOCALE_NAME_LEN)
- return NULL;
-
- memcpy(&aliasbuf[0], &locale[0], matchpos);
- memcpy(&aliasbuf[matchpos], replacement, replacementlen);
- /* includes null terminator */
- memcpy(&aliasbuf[matchpos + replacementlen], rest, restlen + 1);
-
- return aliasbuf;
+ Win32LocaleTableEntry *new_table;
+
+ new_table = malloc(sizeof(*new_table) * table_capacity * 2);
+ if (new_table == NULL)
+ {
+ free_mapping_table(table, table_size);
+ fclose(file);
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(new_table, table, sizeof(*table) * table_size);
+ free(table);
+ table = new_table;
+ table_capacity *= 2;
}
+
+ /* Fill in new entry. */
+ table[table_size].direction = direction;
+ table[table_size].pattern = pattern;
+ table[table_size].replacement = replacement;
+ table_size++;
+ }
+
+ fclose(file);
+
+ /* Mapping table established for this process. */
+ mapping_table = table;
+ mapping_table_size = table_size;
+
+ return 0;
+}
+
+/*
+ * Checks if n bytes of pattern and name match. '?' is treated as a wildcard
+ * in the pattern, but all other bytes must be identical to match.
+ */
+static bool
+subpattern_matches(const char *pattern, const char *name, size_t n)
+{
+ while (n > 0)
+ {
+ /* Have we hit the end of the pattern or name? */
+ if (*pattern == '\0')
+ return *name == '\0';
+ else if (*name == '\0')
+ return false;
+
+ /* Otherwise matches wildcard or exact character. */
+ if (*pattern != '?' && *pattern != *name)
+ return false;
+
+ /* Next. */
+ n--;
+ pattern++;
+ name++;
+ }
+ return true;
+}
+
+/*
+ * Checks if a name matches a pattern, with an extremely simple pattern logic.
+ * The pattern may contain any number of '?' characters to match any character,
+ * and zero or one '*' characters to match any sequence of characters.
+ */
+static bool
+pattern_matches(const char *pattern, const char *name)
+{
+ const char *star;
+
+ if ((star = strchr(pattern, '*')))
+ {
+ size_t len_pattern_before_star;
+ size_t len_pattern_after_star;
+ size_t len_name;
+
+ /* Does the name match the part before the star? */
+ len_pattern_before_star = star - pattern;
+ if (!subpattern_matches(pattern, name, len_pattern_before_star))
+ return false;
+
+ /* Step over the star in the pattern. */
+ pattern += len_pattern_before_star;
+ pattern++;
+ len_pattern_after_star = strlen(pattern);
+
+ /* Step over the star in the name. */
+ name += len_pattern_before_star;
+ len_name = strlen(name);
+ if (len_name < len_pattern_after_star)
+ return false;
+ name += len_name - len_pattern_after_star;
}
- /* no match, just return the original string */
- return locale;
+ return subpattern_matches(pattern, name, SIZE_MAX);
}
+/*
+ * Convert a setlocale() locale name according to the installed mapping table.
+ * Direction should be 'c' for calls, and 'r' for return values.
+ *
+ */
+static const char *
+map_locale(char direction, const char *name)
+{
+ for (size_t i = 0; i < mapping_table_size; ++i)
+ {
+ if (mapping_table[i].direction == direction &&
+ pattern_matches(mapping_table[i].pattern, name))
+ return mapping_table[i].replacement;
+ }
+ return name;
+}
+
+/*
+ * This implementation sets errno and writes messages to stderr for
+ * catastrophic internal failures, though the POSIX function defines no errors
+ * so callers shouldn't generally check errno.
+ */
char *
pgwin32_setlocale(int category, const char *locale)
{
const char *argument;
char *result;
+ if (!mapping_table_initialized)
+ {
+ if (initialize_mapping_table() < 0)
+ return NULL;
+ mapping_table_initialized = true;
+ }
+
+ /*
+ * XXX Call value transformation is relevant as long as we think there are
+ * existing systems that were initdb'd with unstable and non-ASCII locale
+ * names.
+ */
if (locale == NULL)
argument = NULL;
else
- argument = map_locale(locale_map_argument, locale);
+ argument = map_locale('c', locale);
/* Call the real setlocale() function */
result = setlocale(category, argument);
@@ -185,9 +428,13 @@ pgwin32_setlocale(int category, const char *locale)
/*
* setlocale() is specified to return a "char *" that the caller is
* forbidden to modify, so casting away the "const" is innocuous.
+ *
+ * XXX Return value transformation is only relevant as long as we continue
+ * to use setlocale("") as a way to query the default locale names, which
+ * is the source of the unstable and non-ASCII locale names.
*/
if (result)
- result = unconstify(char *, map_locale(locale_map_result, result));
+ result = unconstify(char *, map_locale('r', result));
return result;
}
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 34ec87a85eb..67451e57279 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -3109,6 +3109,7 @@ WalUsage
WalWriteMethod
WalWriteMethodOps
Walfile
+Win32LocaleTableEntry
WindowAgg
WindowAggPath
WindowAggState
--
2.44.0
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-05-15 23:46 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-15 23:46 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Thanks for your questions, Thomas and Tom. + @Vishwa to help with technical questions.
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, May 13, 2024 11:38 PM
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; pgsql-bugs@lists.postgresql.org
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, May 14, 2024 at 11:07 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> +1 for the long-term solution being more-stable locale identifiers.
> However, we should try to build something that will let users get out
> of these situations with the existing identifiers, so I like your idea
> of a plain-text mapping file for Windows locale names.
> I don't think an environment variable is necessary; just define a
> fixed name "$PGDATA/locale_map.txt" or such. If that file exists,
> just read it and map the pg_database field values with it.
OK, I tried that, first draft attached (with my standard proviso that I don't do Windows, I just know that this passes CI and that the code works the way I intended on my local Unix system if extracted into a little harness). With this, you could in theory create a file PGDATA/win32setlocale.map containing:
c Turkish_Turkey.1254=Turkish_Türkiye.1254
... or perhaps more likely:
c Turkish_Turkey.1254=tr-TR.1254
I also absorbed the pre-existing kludge table into the new system by default (though they got a bit shorter 'cause I invented some wildcards). Some problems came up while wondering how to fit Türkiye into the defaults, and how to back-patch:
1. In the back-branches, we claim to support ancient Windows releases as far back as "Windows 2000 SP4" (!), which obviously aren't getting the Windows updates, so I guess "Turkish_Türkiye.1254" will fail there and generally before Windows 10. And even if you exclude the extremities of our support window somehow (how?), modern systems might not have applied the update yet (IIUC they *have* to at some point under the new world order, so there is a defined window of version skew these days).
2. It's generally a terrible idea to be using "ü" in a locale name.
FWIW I assume setlocale() actually accepts and returns names encoded in the current ACP ("active codepage", system-wide changeable setting that controls char↔wchar_t conversion in system APIs), so the encoding of that file (and the built-in default table) would need to match that to work, as coded. Perhaps it would be possible to make the mapping file UTF-8 and transform that to ACP! But it feels a bit too loopy for me, and on the PostgreSQL side it is undefined/illegal whatever you choose in PostgreSQL due to being accessed from different databases which are using potentially different encodings that are only required to be a superset of ASCII. Avoid.
3. Therefore you'd probably want to prefer "tr-TR.1254" as the replacement string. But what is the oldest Windows release that can understand a BCP47 code like that?
4. Conversely, on modern systems, I'm still not entirely sure that "tr-TR.1254" is exactly the same thing as "Turkish-XXX.1254" and that it's OK to put ".1254" on the end like that. Is it, and is it? I don't mean just "does it mean Turkish?", I mean "does it give exactly the same answer for every conceivable pair of strings when compared with strcoll_l(), and likewise for the ctype-based functions like
towlower() et al".
If the answers are not in our favour, I guess we could leave the default behaviour unchanged, and let people set up a text file as shown above to fix their database if they want, but that's also not very nice and kinda weird (helping hypothetical users of museum-grade systems by leaving real users' systems broken).
If the answer to 4 is yes, yes then we could also push ahead with the plan to make initdb pick BCP47 names by default in PG18 (or even 17).
> Maybe this shouldn't even be Windows-specific? Are there any cases
> where it'd save people's bacon on other platforms?
Good question. Sometimes ISO code go away or countries split etc, so it's no like POSIX locale names are set in stone under all circumstances. But on Unixen it's all just files in practice, you can always just symlink them, move them around, compile them yourself from sources, etc, if you really have to, so I think I'd rather contain the crazy in win32*.c.
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-05-17 22:25 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-17 22:25 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Hi Thomas and Tom,
Please let us know your question or concern about the bug we discuss in this mail.
Thanks!
Haifang
-----Original Message-----
From: Haifang Wang (Centific Technologies Inc)
Sent: Wednesday, May 15, 2024 4:47 PM
To: Thomas Munro <thomas.munro@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thanks for your questions, Thomas and Tom. + @Vishwa to help with technical questions.
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, May 13, 2024 11:38 PM
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; pgsql-bugs@lists.postgresql.org
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, May 14, 2024 at 11:07 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> +1 for the long-term solution being more-stable locale identifiers.
> However, we should try to build something that will let users get out
> of these situations with the existing identifiers, so I like your idea
> of a plain-text mapping file for Windows locale names.
> I don't think an environment variable is necessary; just define a
> fixed name "$PGDATA/locale_map.txt" or such. If that file exists,
> just read it and map the pg_database field values with it.
OK, I tried that, first draft attached (with my standard proviso that I don't do Windows, I just know that this passes CI and that the code works the way I intended on my local Unix system if extracted into a little harness). With this, you could in theory create a file PGDATA/win32setlocale.map containing:
c Turkish_Turkey.1254=Turkish_Türkiye.1254
... or perhaps more likely:
c Turkish_Turkey.1254=tr-TR.1254
I also absorbed the pre-existing kludge table into the new system by default (though they got a bit shorter 'cause I invented some wildcards). Some problems came up while wondering how to fit Türkiye into the defaults, and how to back-patch:
1. In the back-branches, we claim to support ancient Windows releases as far back as "Windows 2000 SP4" (!), which obviously aren't getting the Windows updates, so I guess "Turkish_Türkiye.1254" will fail there and generally before Windows 10. And even if you exclude the extremities of our support window somehow (how?), modern systems might not have applied the update yet (IIUC they *have* to at some point under the new world order, so there is a defined window of version skew these days).
2. It's generally a terrible idea to be using "ü" in a locale name.
FWIW I assume setlocale() actually accepts and returns names encoded in the current ACP ("active codepage", system-wide changeable setting that controls char↔wchar_t conversion in system APIs), so the encoding of that file (and the built-in default table) would need to match that to work, as coded. Perhaps it would be possible to make the mapping file UTF-8 and transform that to ACP! But it feels a bit too loopy for me, and on the PostgreSQL side it is undefined/illegal whatever you choose in PostgreSQL due to being accessed from different databases which are using potentially different encodings that are only required to be a superset of ASCII. Avoid.
3. Therefore you'd probably want to prefer "tr-TR.1254" as the replacement string. But what is the oldest Windows release that can understand a BCP47 code like that?
4. Conversely, on modern systems, I'm still not entirely sure that "tr-TR.1254" is exactly the same thing as "Turkish-XXX.1254" and that it's OK to put ".1254" on the end like that. Is it, and is it? I don't mean just "does it mean Turkish?", I mean "does it give exactly the same answer for every conceivable pair of strings when compared with strcoll_l(), and likewise for the ctype-based functions like
towlower() et al".
If the answers are not in our favour, I guess we could leave the default behaviour unchanged, and let people set up a text file as shown above to fix their database if they want, but that's also not very nice and kinda weird (helping hypothetical users of museum-grade systems by leaving real users' systems broken).
If the answer to 4 is yes, yes then we could also push ahead with the plan to make initdb pick BCP47 names by default in PG18 (or even 17).
> Maybe this shouldn't even be Windows-specific? Are there any cases
> where it'd save people's bacon on other platforms?
Good question. Sometimes ISO code go away or countries split etc, so it's no like POSIX locale names are set in stone under all circumstances. But on Unixen it's all just files in practice, you can always just symlink them, move them around, compile them yourself from sources, etc, if you really have to, so I think I'd rather contain the crazy in win32*.c.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-05-18 05:39 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-05-18 05:39 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Sat, May 18, 2024 at 10:25 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Please let us know your question or concern about the bug we discuss in this mail.
Thanks for your help with this! Did I miss an email in between? Here
are some unanswered questions that seem to be stopping progress:
1. What is the oldest Windows release that can understand the "new"
BCP47 locale names, like "tr-TR" or "tr-TR.1452"?
2. If we translate to BCP47 automatically, should we put the ".1452"
on the end? What does it mean exactly? What does it mean if you
don't put it there?
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names?
With answers to those questions we might be able to ship some nice
built-in translations to get users out of this jam. If there are
issues on those points, we might have to face some questions about
what the encoding is of the "Turkish_Türkiye.1254" string itself,
which is tricky for us for technical reasons, among other problems...
not sure.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-05-18 05:47 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Tom Lane @ 2024-05-18 05:47 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Thomas Munro <thomas.munro@gmail.com> writes:
> With answers to those questions we might be able to ship some nice
> built-in translations to get users out of this jam. If there are
> issues on those points, we might have to face some questions about
> what the encoding is of the "Turkish_Türkiye.1254" string itself,
> which is tricky for us for technical reasons, among other problems...
> not sure.
TBH, my idea of how this should go was to *not* ship any built-in
translations, or indeed any translation file at all (so I didn't
like your moving some existing hacks into that file). If we
approach it like that, then individual users who hit this problem
are responsible for creating their own translation file, which
will automatically use whatever is the locally-appropriate
encoding. Sure, it's less transparent for affected users, but
it will work for them which other approaches might not; and
evidence so far is that there's not a huge number of affected
users.
regards, tom lane
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
@ 2024-05-18 05:56 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-05-18 05:56 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Sat, May 18, 2024 at 5:47 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@gmail.com> writes:
> > With answers to those questions we might be able to ship some nice
> > built-in translations to get users out of this jam. If there are
> > issues on those points, we might have to face some questions about
> > what the encoding is of the "Turkish_Türkiye.1254" string itself,
> > which is tricky for us for technical reasons, among other problems...
> > not sure.
>
> TBH, my idea of how this should go was to *not* ship any built-in
> translations, or indeed any translation file at all (so I didn't
> like your moving some existing hacks into that file). If we
> approach it like that, then individual users who hit this problem
> are responsible for creating their own translation file, which
> will automatically use whatever is the locally-appropriate
> encoding. Sure, it's less transparent for affected users, but
> it will work for them which other approaches might not; and
> evidence so far is that there's not a huge number of affected
> users.
Hmm, yeah I guess we could just ship a patch like what I posted
already, and let users figure out what works. I would still like to
know the answer to those questions so we can offer good advice. If
the answers are all yes then I think we can say "the file is in
encoded in ASCII; use wildcards to deal with any legacy non-ASCII
locale names on the left, and use BCP47 names on the right" and begin
expunging the bad old names from our universe.
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-05-20 20:17 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-20 20:17 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Hi Thomas,
What questions do you have? Could you please list them clearly so that Vishwa could help to answer?
NOTE: this email is plain text format, not easy to read. And also the previous email content usually is not included in the latest email, we only could see the most latest one.
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Friday, May 17, 2024 10:57 PM
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Sat, May 18, 2024 at 5:47 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@gmail.com> writes:
> > With answers to those questions we might be able to ship some nice
> > built-in translations to get users out of this jam. If there are
> > issues on those points, we might have to face some questions about
> > what the encoding is of the "Turkish_Türkiye.1254" string itself,
> > which is tricky for us for technical reasons, among other problems...
> > not sure.
>
> TBH, my idea of how this should go was to *not* ship any built-in
> translations, or indeed any translation file at all (so I didn't like
> your moving some existing hacks into that file). If we approach it
> like that, then individual users who hit this problem are responsible
> for creating their own translation file, which will automatically use
> whatever is the locally-appropriate encoding. Sure, it's less
> transparent for affected users, but it will work for them which other
> approaches might not; and evidence so far is that there's not a huge
> number of affected users.
Hmm, yeah I guess we could just ship a patch like what I posted already, and let users figure out what works. I would still like to know the answer to those questions so we can offer good advice. If the answers are all yes then I think we can say "the file is in encoded in ASCII; use wildcards to deal with any legacy non-ASCII locale names on the left, and use BCP47 names on the right" and begin expunging the bad old names from our universe.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-05-20 20:56 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-05-20 20:56 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Tue, May 21, 2024 at 8:17 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> What questions do you have? Could you please list them clearly so that Vishwa could help to answer?
I already did, twice, but perhaps Vishwa or others can't see the whole
thread, so here is this whole thread in our project email archive:
https://www.postgresql.org/message-id/flat/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.na...
But let me ask the questions again, with some motivation/reason I want
to know in parentheses:
1. What is the oldest Windows release that can understand the "new"
BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL
versions, for example PostgreSQL 12, are expected to run on old
versions of Windows from long before Windows 10, so we might have to
consider this. However, if we go with Tom's idea that we do nothing
by default but just allow users to supply their own optional mapping
file, then this question becomes unimportant, users can figure out for
themselves whether it works, and presumably only 10+ got the update
that renamed Turkey to Türkiye. [And in reality, I hope/expect that
no one really does run old out-of-support OSes, because that's crazy,
but I'm not allowed to assume...])
2. If we translate to BCP47 locale names like "tr-TR" automatically,
should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if
you don't put it on, the encoding in "char"-based functions is the
"ACP". What I really want to know is, can it be different from the
"ACP", and if it is, which functions does it affect? For example if
the ACP is 1521 and I call _tolower_l() giving it a locale_t that I
opened with "en-US.UTF-8", what happens? I am sure this is a simple
question but we are not Windows programmers, you are the first person
to show up offering to investigate, and I personally found the docs a
bit light on the topic.)
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In
other words, is it *exactly the same code and driving data*, just
using different labels? Or is it a new locale implementation that
could differ arbitrarily in behaviour? If the answer is yes, it's
just a new naming scheme, then life will be much much simpler for our
users, but if not, then indexes might be corrupted if we tell people
to switch to the new BCP47 names, and so we'd better know about that,
so we can adjust our advice to users.)
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-05-20 23:32 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-20 23:32 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Hi Vishwa,
Could you please help with the questions below?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, May 20, 2024 1:57 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, May 21, 2024 at 8:17 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> What questions do you have? Could you please list them clearly so that Vishwa could help to answer?
I already did, twice, but perhaps Vishwa or others can't see the whole thread, so here is this whole thread in our project email archive:
https://www.postgresql.org/message-id/flat/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.na...
But let me ask the questions again, with some motivation/reason I want to know in parentheses:
1. What is the oldest Windows release that can understand the "new"
BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL versions, for example PostgreSQL 12, are expected to run on old versions of Windows from long before Windows 10, so we might have to consider this. However, if we go with Tom's idea that we do nothing by default but just allow users to supply their own optional mapping file, then this question becomes unimportant, users can figure out for themselves whether it works, and presumably only 10+ got the update that renamed Turkey to Türkiye. [And in reality, I hope/expect that no one really does run old out-of-support OSes, because that's crazy, but I'm not allowed to assume...])
2. If we translate to BCP47 locale names like "tr-TR" automatically, should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if you don't put it on, the encoding in "char"-based functions is the "ACP". What I really want to know is, can it be different from the "ACP", and if it is, which functions does it affect? For example if the ACP is 1521 and I call _tolower_l() giving it a locale_t that I opened with "en-US.UTF-8", what happens? I am sure this is a simple question but we are not Windows programmers, you are the first person to show up offering to investigate, and I personally found the docs a bit light on the topic.)
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In other words, is it *exactly the same code and driving data*, just using different labels? Or is it a new locale implementation that could differ arbitrarily in behaviour? If the answer is yes, it's just a new naming scheme, then life will be much much simpler for our users, but if not, then indexes might be corrupted if we tell people to switch to the new BCP47 names, and so we'd better know about that, so we can adjust our advice to users.)
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-05-21 08:27 ` Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Vishwa Deepak @ 2024-05-21 08:27 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; Rahul Pandey <pandeyrah@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Hey @Haifang Wang (Centific Technologies Inc)<mailto:v-haiwang@microsoft.com>
I am adding experts in this thread to address these queries. @Amy Wishnousky<mailto:amyw@microsoft.com> @Shawn Steele<mailto:Shawn.Steele@microsoft.com> @Rahul Pandey<mailto:pandeyrah@microsoft.com>
Adding my inline comment to best of my knowledge.
Thanks & Regards
Vishwa
________________________________
From: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Sent: Tuesday, May 21, 2024 5:02 AM
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi Vishwa,
Could you please help with the questions below?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, May 20, 2024 1:57 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, May 21, 2024 at 8:17 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> What questions do you have? Could you please list them clearly so that Vishwa could help to answer?
I already did, twice, but perhaps Vishwa or others can't see the whole thread, so here is this whole thread in our project email archive:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fmessage-id%2F...;
But let me ask the questions again, with some motivation/reason I want to know in parentheses:
1. What is the oldest Windows release that can understand the "new"
BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL versions, for example PostgreSQL 12, are expected to run on old versions of Windows from long before Windows 10, so we might have to consider this. However, if we go with Tom's idea that we do nothing by default but just allow users to supply their own optional mapping file, then this question becomes unimportant, users can figure out for themselves whether it works, and presumably only 10+ got the update that renamed Turkey to Türkiye. [And in reality, I hope/expect that no one really does run old out-of-support OSes, because that's crazy, but I'm not allowed to assume...])
Its difficult for me to answer this question with accuracy. I can see BCP47 related code in win8, so my assumption is that window 8 and above will support it.
May be added expert from feature team can validate this assumption.
2. If we translate to BCP47 locale names like "tr-TR" automatically, should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if you don't put it on, the encoding in "char"-based functions is the "ACP". What I really want to know is, can it be different from the "ACP", and if it is, which functions does it affect? For example, if the ACP is 1521 and I call _tolower_l() giving it a locale_t that I opened with "en-US.UTF-8", what happens? I am sure this is a simple question but we are not Windows programmers, you are the first person to show up offering to investigate, and I personally found the docs a bit light on the topic.)
It tries to figure out the best match for the given input locale. Below link explain in more detail. As far as codepage part is concerned, may be expert add the details
https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags
[https://learn.microsoft.com/en-us/media/open-graph-image.png]<https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags;
How the Resource Management System matches language tags - UWP applications<https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags;
The previous topic (How the Resource Management System matches and chooses resources) looks at qualifier-matching in general. This topic focuses on language-tag-matching in more detail.
learn.microsoft.com
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In other words, is it *exactly the same code and driving data*, just using different labels? Or is it a new locale implementation that could differ arbitrarily in behaviour? If the answer is yes, it's just a new naming scheme, then life will be much much simpler for our users, but if not, then indexes might be corrupted if we tell people to switch to the new BCP47 names, and so we'd better know about that, so we can adjust our advice to users.)
Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü
Please do proper due diligence at your end before proceeding with any kind of mapping.
Regards
Vishwa
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
@ 2024-05-22 11:37 ` Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Rahul Pandey @ 2024-05-22 11:37 UTC (permalink / raw)
To: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Thanks, Vishwa, for tagging me.
Adding my two cents,
Hello Thomas,
1. What is the oldest Windows release that can understand the "new" BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL versions, for example PostgreSQL 12, are expected to run on old versions of Windows from long before Windows 10, so we might have to consider this. However, if we go with Tom's idea that we do nothing by default but just allow users to supply their own optional mapping file, then this question becomes unimportant, users can figure out for themselves whether it works, and presumably only 10+ got the update that renamed Turkey to Türkiye. [And in reality, I hope/expect that no one really does run old out-of-support OSes, because that's crazy, but I'm not allowed to assume...])
Vishwa: Its difficult for me to answer this question with accuracy. I can see BCP47 related code in win8, so my assumption is that window 8 and above will support it.
May be added expert from feature team can validate this assumption.
Rahul: Locale names based on BCP 47 were first introduced in Windows Vista timeframe, so using them should be pretty safe for most modern and older versions (unless its XP or earlier).
2. If we translate to BCP47 locale names like "tr-TR" automatically, should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if you don't put it on, the encoding in "char"-based functions is the "ACP". What I really want to know is, can it be different from the "ACP", and if it is, which functions does it affect? For example, if the ACP is 1521 and I call _tolower_l() giving it a locale_t that I opened with "en-US.UTF-8", what happens? I am sure this is a simple question but we are not Windows programmers, you are the first person to show up offering to investigate, and I personally found the docs a bit light on the topic.)
Vishwa: It tries to figure out the best match for the given input locale. Below link explain in more detail. As far as codepage part is concerned, may be expert add the details
https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags
Rahul: For the first part, your assumption is correct. The behaviour for "tr-TR" and "tr-TR.ACP" would be same and it would try to use the default ANSI Code Page for Turkish (which happens to be 1254<https://en.wikipedia.org/wiki/Windows-1254;). Using any other code page (for example"tr-TR.1252") would use that codepage (1252: English). For the second part (example), I am not sure if I understand the question completely, but mixing the encoding is almost never a good idea and could lead to mojibaked strings in the worst case to no change (if strings only contain ASCII chars) in the best-case scenario.
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In other words, is it *exactly the same code and driving data*, just using different labels? Or is it a new locale implementation that could differ arbitrarily in behaviour? If the answer is yes, it's just a new naming scheme, then life will be much much simpler for our users, but if not, then indexes might be corrupted if we tell people to switch to the new BCP47 names, and so we'd better know about that, so we can adjust our advice to users.)
Vishwa: Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü
Rahul: I agree with Vishwa. the locale is the same, just the name of the country in English is changed. Rest all data is the same.
Thanks,
Rahul
________________________________
From: Vishwa Deepak <Vishwa.Deepak@microsoft.com>
Sent: Tuesday, May 21, 2024 1:57 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; Rahul Pandey <pandeyrah@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hey @Haifang Wang (Centific Technologies Inc)<mailto:v-haiwang@microsoft.com>
I am adding experts in this thread to address these queries. @Amy Wishnousky<mailto:amyw@microsoft.com> @Shawn Steele<mailto:Shawn.Steele@microsoft.com> @Rahul Pandey<mailto:pandeyrah@microsoft.com>
Adding my inline comment to best of my knowledge.
Thanks & Regards
Vishwa
________________________________
From: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Sent: Tuesday, May 21, 2024 5:02 AM
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi Vishwa,
Could you please help with the questions below?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, May 20, 2024 1:57 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; pgsql-bugs@lists.postgresql.org
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, May 21, 2024 at 8:17 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> What questions do you have? Could you please list them clearly so that Vishwa could help to answer?
I already did, twice, but perhaps Vishwa or others can't see the whole thread, so here is this whole thread in our project email archive:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fmessage-id%2F...;
But let me ask the questions again, with some motivation/reason I want to know in parentheses:
1. What is the oldest Windows release that can understand the "new"
BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL versions, for example PostgreSQL 12, are expected to run on old versions of Windows from long before Windows 10, so we might have to consider this. However, if we go with Tom's idea that we do nothing by default but just allow users to supply their own optional mapping file, then this question becomes unimportant, users can figure out for themselves whether it works, and presumably only 10+ got the update that renamed Turkey to Türkiye. [And in reality, I hope/expect that no one really does run old out-of-support OSes, because that's crazy, but I'm not allowed to assume...])
Its difficult for me to answer this question with accuracy. I can see BCP47 related code in win8, so my assumption is that window 8 and above will support it.
May be added expert from feature team can validate this assumption.
2. If we translate to BCP47 locale names like "tr-TR" automatically, should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if you don't put it on, the encoding in "char"-based functions is the "ACP". What I really want to know is, can it be different from the "ACP", and if it is, which functions does it affect? For example, if the ACP is 1521 and I call _tolower_l() giving it a locale_t that I opened with "en-US.UTF-8", what happens? I am sure this is a simple question but we are not Windows programmers, you are the first person to show up offering to investigate, and I personally found the docs a bit light on the topic.)
It tries to figure out the best match for the given input locale. Below link explain in more detail. As far as codepage part is concerned, may be expert add the details
https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags
[https://learn.microsoft.com/en-us/media/open-graph-image.png]<https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags;
How the Resource Management System matches language tags - UWP applications<https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags;
The previous topic (How the Resource Management System matches and chooses resources) looks at qualifier-matching in general. This topic focuses on language-tag-matching in more detail.
learn.microsoft.com
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In other words, is it *exactly the same code and driving data*, just using different labels? Or is it a new locale implementation that could differ arbitrarily in behaviour? If the answer is yes, it's just a new naming scheme, then life will be much much simpler for our users, but if not, then indexes might be corrupted if we tell people to switch to the new BCP47 names, and so we'd better know about that, so we can adjust our advice to users.)
Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü
Please do proper due diligence at your end before proceeding with any kind of mapping.
Regards
Vishwa
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
@ 2024-05-28 18:21 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-05-28 18:21 UTC (permalink / raw)
To: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Thanks Vishwa for all the clarification below.
Hi @Rahul<mailto:pandeyrah@microsoft.com> and everyone,
Is there anything else not clear? Is there any solution for the issue?
Thanks!
Haifang
From: Rahul Pandey <pandeyrah@microsoft.com>
Sent: Wednesday, May 22, 2024 4:37 AM
To: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thanks, Vishwa, for tagging me.
Adding my two cents,
Hello Thomas,
1. What is the oldest Windows release that can understand the "new" BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL versions, for example PostgreSQL 12, are expected to run on old versions of Windows from long before Windows 10, so we might have to consider this. However, if we go with Tom's idea that we do nothing by default but just allow users to supply their own optional mapping file, then this question becomes unimportant, users can figure out for themselves whether it works, and presumably only 10+ got the update that renamed Turkey to Türkiye. [And in reality, I hope/expect that no one really does run old out-of-support OSes, because that's crazy, but I'm not allowed to assume...])
Vishwa: Its difficult for me to answer this question with accuracy. I can see BCP47 related code in win8, so my assumption is that window 8 and above will support it.
May be added expert from feature team can validate this assumption.
Rahul: Locale names based on BCP 47 were first introduced in Windows Vista timeframe, so using them should be pretty safe for most modern and older versions (unless its XP or earlier).
2. If we translate to BCP47 locale names like "tr-TR" automatically, should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if you don't put it on, the encoding in "char"-based functions is the "ACP". What I really want to know is, can it be different from the "ACP", and if it is, which functions does it affect? For example, if the ACP is 1521 and I call _tolower_l() giving it a locale_t that I opened with "en-US.UTF-8", what happens? I am sure this is a simple question but we are not Windows programmers, you are the first person to show up offering to investigate, and I personally found the docs a bit light on the topic.)
Vishwa: It tries to figure out the best match for the given input locale. Below link explain in more detail. As far as codepage part is concerned, may be expert add the details
https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags
Rahul: For the first part, your assumption is correct. The behaviour for "tr-TR" and "tr-TR.ACP" would be same and it would try to use the default ANSI Code Page for Turkish (which happens to be 1254<https://en.wikipedia.org/wiki/Windows-1254;). Using any other code page (for example"tr-TR.1252") would use that codepage (1252: English). For the second part (example), I am not sure if I understand the question completely, but mixing the encoding is almost never a good idea and could lead to mojibaked strings in the worst case to no change (if strings only contain ASCII chars) in the best-case scenario.
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In other words, is it *exactly the same code and driving data*, just using different labels? Or is it a new locale implementation that could differ arbitrarily in behaviour? If the answer is yes, it's just a new naming scheme, then life will be much much simpler for our users, but if not, then indexes might be corrupted if we tell people to switch to the new BCP47 names, and so we'd better know about that, so we can adjust our advice to users.)
Vishwa: Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü
Rahul: I agree with Vishwa. the locale is the same, just the name of the country in English is changed. Rest all data is the same.
Thanks,
Rahul
________________________________
From: Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>
Sent: Tuesday, May 21, 2024 1:57 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>; Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>; Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>
Cc: Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org> <pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hey @Haifang Wang (Centific Technologies Inc)<mailto:v-haiwang@microsoft.com>
I am adding experts in this thread to address these queries. @Amy Wishnousky<mailto:amyw@microsoft.com> @Shawn Steele<mailto:Shawn.Steele@microsoft.com> @Rahul Pandey<mailto:pandeyrah@microsoft.com>
Adding my inline comment to best of my knowledge.
Thanks & Regards
Vishwa
________________________________
From: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Sent: Tuesday, May 21, 2024 5:02 AM
To: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Cc: Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org> <pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi Vishwa,
Could you please help with the questions below?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Sent: Monday, May 20, 2024 1:57 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Cc: Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, May 21, 2024 at 8:17 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>> wrote:
> What questions do you have? Could you please list them clearly so that Vishwa could help to answer?
I already did, twice, but perhaps Vishwa or others can't see the whole thread, so here is this whole thread in our project email archive:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fmessage-id%2F...;
But let me ask the questions again, with some motivation/reason I want to know in parentheses:
1. What is the oldest Windows release that can understand the "new"
BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL versions, for example PostgreSQL 12, are expected to run on old versions of Windows from long before Windows 10, so we might have to consider this. However, if we go with Tom's idea that we do nothing by default but just allow users to supply their own optional mapping file, then this question becomes unimportant, users can figure out for themselves whether it works, and presumably only 10+ got the update that renamed Turkey to Türkiye. [And in reality, I hope/expect that no one really does run old out-of-support OSes, because that's crazy, but I'm not allowed to assume...])
Its difficult for me to answer this question with accuracy. I can see BCP47 related code in win8, so my assumption is that window 8 and above will support it.
May be added expert from feature team can validate this assumption.
2. If we translate to BCP47 locale names like "tr-TR" automatically, should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if you don't put it on, the encoding in "char"-based functions is the "ACP". What I really want to know is, can it be different from the "ACP", and if it is, which functions does it affect? For example, if the ACP is 1521 and I call _tolower_l() giving it a locale_t that I opened with "en-US.UTF-8", what happens? I am sure this is a simple question but we are not Windows programmers, you are the first person to show up offering to investigate, and I personally found the docs a bit light on the topic.)
It tries to figure out the best match for the given input locale. Below link explain in more detail. As far as codepage part is concerned, may be expert add the details
https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags
[https://learn.microsoft.com/en-us/media/open-graph-image.png]<https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags;
How the Resource Management System matches language tags - UWP applications<https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags;
The previous topic (How the Resource Management System matches and chooses resources) looks at qualifier-matching in general. This topic focuses on language-tag-matching in more detail.
learn.microsoft.com
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In other words, is it *exactly the same code and driving data*, just using different labels? Or is it a new locale implementation that could differ arbitrarily in behaviour? If the answer is yes, it's just a new naming scheme, then life will be much much simpler for our users, but if not, then indexes might be corrupted if we tell people to switch to the new BCP47 names, and so we'd better know about that, so we can adjust our advice to users.)
Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü
Please do proper due diligence at your end before proceeding with any kind of mapping.
Regards
Vishwa
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-06-03 13:00 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-06-03 13:00 UTC (permalink / raw)
To: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Hi Thomas and Team,
Just would like to follow up with you about this bug. Hope Rahul and Vishwa have answered all your questions below. Did you get chance to do investigations? Any other questions?
Thanks!
Haifang
From: Haifang Wang (Centific Technologies Inc)
Sent: Tuesday, May 28, 2024 11:21 AM
To: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thanks Vishwa for all the clarification below.
Hi @Rahul<mailto:pandeyrah@microsoft.com> and everyone,
Is there anything else not clear? Is there any solution for the issue?
Thanks!
Haifang
From: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>
Sent: Wednesday, May 22, 2024 4:37 AM
To: Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>; Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>
Cc: Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thanks, Vishwa, for tagging me.
Adding my two cents,
Hello Thomas,
1. What is the oldest Windows release that can understand the "new" BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL versions, for example PostgreSQL 12, are expected to run on old versions of Windows from long before Windows 10, so we might have to consider this. However, if we go with Tom's idea that we do nothing by default but just allow users to supply their own optional mapping file, then this question becomes unimportant, users can figure out for themselves whether it works, and presumably only 10+ got the update that renamed Turkey to Türkiye. [And in reality, I hope/expect that no one really does run old out-of-support OSes, because that's crazy, but I'm not allowed to assume...])
Vishwa: Its difficult for me to answer this question with accuracy. I can see BCP47 related code in win8, so my assumption is that window 8 and above will support it.
May be added expert from feature team can validate this assumption.
Rahul: Locale names based on BCP 47 were first introduced in Windows Vista timeframe, so using them should be pretty safe for most modern and older versions (unless its XP or earlier).
2. If we translate to BCP47 locale names like "tr-TR" automatically, should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if you don't put it on, the encoding in "char"-based functions is the "ACP". What I really want to know is, can it be different from the "ACP", and if it is, which functions does it affect? For example, if the ACP is 1521 and I call _tolower_l() giving it a locale_t that I opened with "en-US.UTF-8", what happens? I am sure this is a simple question but we are not Windows programmers, you are the first person to show up offering to investigate, and I personally found the docs a bit light on the topic.)
Vishwa: It tries to figure out the best match for the given input locale. Below link explain in more detail. As far as codepage part is concerned, may be expert add the details
https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags
Rahul: For the first part, your assumption is correct. The behaviour for "tr-TR" and "tr-TR.ACP" would be same and it would try to use the default ANSI Code Page for Turkish (which happens to be 1254<https://en.wikipedia.org/wiki/Windows-1254;). Using any other code page (for example"tr-TR.1252") would use that codepage (1252: English). For the second part (example), I am not sure if I understand the question completely, but mixing the encoding is almost never a good idea and could lead to mojibaked strings in the worst case to no change (if strings only contain ASCII chars) in the best-case scenario.
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In other words, is it *exactly the same code and driving data*, just using different labels? Or is it a new locale implementation that could differ arbitrarily in behaviour? If the answer is yes, it's just a new naming scheme, then life will be much much simpler for our users, but if not, then indexes might be corrupted if we tell people to switch to the new BCP47 names, and so we'd better know about that, so we can adjust our advice to users.)
Vishwa: Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü
Rahul: I agree with Vishwa. the locale is the same, just the name of the country in English is changed. Rest all data is the same.
Thanks,
Rahul
________________________________
From: Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>
Sent: Tuesday, May 21, 2024 1:57 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>; Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>; Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>
Cc: Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org> <pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hey @Haifang Wang (Centific Technologies Inc)<mailto:v-haiwang@microsoft.com>
I am adding experts in this thread to address these queries. @Amy Wishnousky<mailto:amyw@microsoft.com> @Shawn Steele<mailto:Shawn.Steele@microsoft.com> @Rahul Pandey<mailto:pandeyrah@microsoft.com>
Adding my inline comment to best of my knowledge.
Thanks & Regards
Vishwa
________________________________
From: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Sent: Tuesday, May 21, 2024 5:02 AM
To: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Cc: Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org> <pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi Vishwa,
Could you please help with the questions below?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Sent: Monday, May 20, 2024 1:57 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Cc: Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, May 21, 2024 at 8:17 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>> wrote:
> What questions do you have? Could you please list them clearly so that Vishwa could help to answer?
I already did, twice, but perhaps Vishwa or others can't see the whole thread, so here is this whole thread in our project email archive:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fmessage-id%2F...;
But let me ask the questions again, with some motivation/reason I want to know in parentheses:
1. What is the oldest Windows release that can understand the "new"
BCP47 locale names, like "tr-TR" or "tr-TR.1452"? (Some PostgreSQL versions, for example PostgreSQL 12, are expected to run on old versions of Windows from long before Windows 10, so we might have to consider this. However, if we go with Tom's idea that we do nothing by default but just allow users to supply their own optional mapping file, then this question becomes unimportant, users can figure out for themselves whether it works, and presumably only 10+ got the update that renamed Turkey to Türkiye. [And in reality, I hope/expect that no one really does run old out-of-support OSes, because that's crazy, but I'm not allowed to assume...])
Its difficult for me to answer this question with accuracy. I can see BCP47 related code in win8, so my assumption is that window 8 and above will support it.
May be added expert from feature team can validate this assumption.
2. If we translate to BCP47 locale names like "tr-TR" automatically, should we put the ".1452" on the end? What does it mean exactly?
What does it mean if you don't put it there? (I could guess that if you don't put it on, the encoding in "char"-based functions is the "ACP". What I really want to know is, can it be different from the "ACP", and if it is, which functions does it affect? For example, if the ACP is 1521 and I call _tolower_l() giving it a locale_t that I opened with "en-US.UTF-8", what happens? I am sure this is a simple question but we are not Windows programmers, you are the first person to show up offering to investigate, and I personally found the docs a bit light on the topic.)
It tries to figure out the best match for the given input locale. Below link explain in more detail. As far as codepage part is concerned, may be expert add the details
https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags
[https://learn.microsoft.com/en-us/media/open-graph-image.png]<https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags;
How the Resource Management System matches language tags - UWP applications<https://learn.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags;
The previous topic (How the Resource Management System matches and chooses resources) looks at qualifier-matching in general. This topic focuses on language-tag-matching in more detail.
learn.microsoft.com
3. Do the new BCP47 locale names give *exactly* the same results for
strcoll() and tolower() etc, as the old "Turkish*" style names? (In other words, is it *exactly the same code and driving data*, just using different labels? Or is it a new locale implementation that could differ arbitrarily in behaviour? If the answer is yes, it's just a new naming scheme, then life will be much much simpler for our users, but if not, then indexes might be corrupted if we tell people to switch to the new BCP47 names, and so we'd better know about that, so we can adjust our advice to users.)
Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü
Please do proper due diligence at your end before proceeding with any kind of mapping.
Regards
Vishwa
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-06-03 21:22 ` Thomas Munro <thomas.munro@gmail.com>
2024-06-03 22:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-06-04 00:09 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 3 replies; 73+ messages in thread
From: Thomas Munro @ 2024-06-03 21:22 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Tue, Jun 4, 2024 at 1:00 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Just would like to follow up with you about this bug. Hope Rahul and Vishwa have answered all your questions below. Did you get chance to do investigations? Any other questions?
Hi,
Thanks for all your feedback! Sorry for my late replies, I was
travelling and at a conference last week (at which one of the topics
was "what are we going to do about the sorry state of PostgreSQL on
Windows", but that's a wider topic than this thread...)
The answers are all useful, thank you. There was just one thing I
wanted to clarify. Vishwa said:
"Yes, its exactly the same code and driving data , only spelling is
changed which included replcement of u with ü"
That sounds like it is answering the question 'Do
"Turkish_Turkey.1254" and "Turkish_Türkiye.1254" behave identically?',
which I had already assumed to be true, but I was actually asking 'Do
""Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all
behave identically?'. It sounds like the answer is probably yes, but
the mention of "u" vs "ü" implied a narrower answer than I was looking
for... It's important, because we're proposing to translate to
"tr-TR.1254".
Since no one has come forward to test the patch I wrote on Windows, I
think my next move will be to try to make a build option that can also
do locale name renaming on Unix, so that I have something that I could
test myself and push for the next release of PostgreSQL which will be
in October.
One open question is whether we should ship a translation file
ourselves. I have heard two opinions: Tom Lane proposed in this
thread that there should be no file initially, we let the user figure
out what to put in there. Magnus Hagander proposed at the pgconf.dev
conference last week that we should ideally ship a complete
translation file and maintain it over time, and it should be installed
not in pgdata but rather in the install directory. I am not
personally able or willing to maintain such a file, I'm only offering
to supply the C code to read it and do what it says, but perhaps a
group such as the EDB Installer maintainer group, or at least someone
with a vested interest in PostgreSQL on Windows, might like to own
that job.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-06-03 22:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-06-04 00:13 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2 siblings, 1 reply; 73+ messages in thread
From: Tom Lane @ 2024-06-03 22:54 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; Magnus Hagander <magnus@hagander.net>
Thomas Munro <thomas.munro@gmail.com> writes:
> One open question is whether we should ship a translation file
> ourselves. I have heard two opinions: Tom Lane proposed in this
> thread that there should be no file initially, we let the user figure
> out what to put in there. Magnus Hagander proposed at the pgconf.dev
> conference last week that we should ideally ship a complete
> translation file and maintain it over time, and it should be installed
> not in pgdata but rather in the install directory.
FWIW, I'm kind of down on the latter approach, because I don't think
it'll move the needle very far. Based on track record so far, there's
no chance that we will be aware of a Microsoft locale renaming before
it starts breaking users' databases. Therefore, "edit the translation
file" is going to have to be a documented process in any case, because
affected users are not going to want to wait around for our next
release for a fix. Also, if people do have to do that, it doesn't
seem like a great idea to tell them to modify an installed file rather
than a cluster-local configuration file. What if they do a minor
version update but the minor version doesn't (yet) contain the fix?
Admittedly, the installed-file approach could make it more transparent
for people who'd done a PG minor update before the relevant Windows
update. I'm not sure how large that set of people will be, though.
regards, tom lane
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-03 22:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
@ 2024-06-04 00:13 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-05 06:20 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-06-04 00:13 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Thomas Munro <thomas.munro@gmail.com>; +Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; Magnus Hagander <magnus@hagander.net>
Thanks, Tom. Is there any suggestion on how to track all the conversations in one thread? Seems like all our previous discussion are in different mail thread. It is not easy to track. 😊
Regards!
Haifang
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Monday, June 3, 2024 3:55 PM
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; Magnus Hagander <magnus@hagander.net>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thomas Munro <thomas.munro@gmail.com> writes:
> One open question is whether we should ship a translation file
> ourselves. I have heard two opinions: Tom Lane proposed in this
> thread that there should be no file initially, we let the user figure
> out what to put in there. Magnus Hagander proposed at the pgconf.dev
> conference last week that we should ideally ship a complete
> translation file and maintain it over time, and it should be installed
> not in pgdata but rather in the install directory.
FWIW, I'm kind of down on the latter approach, because I don't think it'll move the needle very far. Based on track record so far, there's no chance that we will be aware of a Microsoft locale renaming before it starts breaking users' databases. Therefore, "edit the translation file" is going to have to be a documented process in any case, because affected users are not going to want to wait around for our next release for a fix. Also, if people do have to do that, it doesn't seem like a great idea to tell them to modify an installed file rather than a cluster-local configuration file. What if they do a minor version update but the minor version doesn't (yet) contain the fix?
Admittedly, the installed-file approach could make it more transparent for people who'd done a PG minor update before the relevant Windows update. I'm not sure how large that set of people will be, though.
regards, tom lane
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-03 22:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-06-04 00:13 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-06-05 06:20 ` Thomas Munro <thomas.munro@gmail.com>
0 siblings, 0 replies; 73+ messages in thread
From: Thomas Munro @ 2024-06-05 06:20 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; Magnus Hagander <magnus@hagander.net>
On Tue, Jun 4, 2024 at 12:13 PM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Thanks, Tom. Is there any suggestion on how to track all the conversations in one thread? Seems like all our previous discussion are in different mail thread. It is not easy to track. 😊
FWIW this shows up as one thread in my email client, and in the
PostgreSQL archives website[1]. I don't know much about email and
which RFCs or conventions are at work here, but apparently different
clients are using different techniques to identify threads. I assume
it could be done with thread headers (as seen in this thread) or
reply-to chains or fuzzy recognition of subject etc. Given that
Outlook seems to ignore the "> " inline response quoting convention
used by the rest of the internet, it wouldn't surprise me to hear that
it also doesn't follow the conventions for recognising threads either,
being a sort of related topic.
[1] https://www.postgresql.org/message-id/flat/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.na...
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-06-04 00:09 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-05 09:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-06-04 00:09 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Thanks, Thomas. I would leave the questions to Vishwa and Rahul to answer.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, June 3, 2024 2:22 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Jun 4, 2024 at 1:00 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Just would like to follow up with you about this bug. Hope Rahul and Vishwa have answered all your questions below. Did you get chance to do investigations? Any other questions?
Hi,
Thanks for all your feedback! Sorry for my late replies, I was travelling and at a conference last week (at which one of the topics was "what are we going to do about the sorry state of PostgreSQL on Windows", but that's a wider topic than this thread...)
The answers are all useful, thank you. There was just one thing I wanted to clarify. Vishwa said:
"Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü"
That sounds like it is answering the question 'Do "Turkish_Turkey.1254" and "Turkish_Türkiye.1254" behave identically?', which I had already assumed to be true, but I was actually asking 'Do ""Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?'. It sounds like the answer is probably yes, but the mention of "u" vs "ü" implied a narrower answer than I was looking for... It's important, because we're proposing to translate to "tr-TR.1254".
Since no one has come forward to test the patch I wrote on Windows, I think my next move will be to try to make a build option that can also do locale name renaming on Unix, so that I have something that I could test myself and push for the next release of PostgreSQL which will be in October.
One open question is whether we should ship a translation file ourselves. I have heard two opinions: Tom Lane proposed in this thread that there should be no file initially, we let the user figure out what to put in there. Magnus Hagander proposed at the pgconf.dev conference last week that we should ideally ship a complete translation file and maintain it over time, and it should be installed not in pgdata but rather in the install directory. I am not personally able or willing to maintain such a file, I'm only offering to supply the C code to read it and do what it says, but perhaps a group such as the EDB Installer maintainer group, or at least someone with a vested interest in PostgreSQL on Windows, might like to own that job.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-04 00:09 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-06-05 09:10 ` Rahul Pandey <pandeyrah@microsoft.com>
2024-06-06 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-13 18:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 2 replies; 73+ messages in thread
From: Rahul Pandey @ 2024-06-05 09:10 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; +Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; 🎯dev <targetdev@microsoft.com>
Hi,
"Do "Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?"
You are correct, they all behave in exactly the same way.
I too would recommend using "tr-TR.1254" since BCP47 tags have a defined structure and this would make the implementation more future proof.
As for translation files, apologies I neither have a preference nor expertise to comment on this.
________________________________
From: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Sent: Tuesday, June 4, 2024 5:39 AM
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thanks, Thomas. I would leave the questions to Vishwa and Rahul to answer.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, June 3, 2024 2:22 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Jun 4, 2024 at 1:00 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Just would like to follow up with you about this bug. Hope Rahul and Vishwa have answered all your questions below. Did you get chance to do investigations? Any other questions?
Hi,
Thanks for all your feedback! Sorry for my late replies, I was travelling and at a conference last week (at which one of the topics was "what are we going to do about the sorry state of PostgreSQL on Windows", but that's a wider topic than this thread...)
The answers are all useful, thank you. There was just one thing I wanted to clarify. Vishwa said:
"Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü"
That sounds like it is answering the question 'Do "Turkish_Turkey.1254" and "Turkish_Türkiye.1254" behave identically?', which I had already assumed to be true, but I was actually asking 'Do ""Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?'. It sounds like the answer is probably yes, but the mention of "u" vs "ü" implied a narrower answer than I was looking for... It's important, because we're proposing to translate to "tr-TR.1254".
Since no one has come forward to test the patch I wrote on Windows, I think my next move will be to try to make a build option that can also do locale name renaming on Unix, so that I have something that I could test myself and push for the next release of PostgreSQL which will be in October.
One open question is whether we should ship a translation file ourselves. I have heard two opinions: Tom Lane proposed in this thread that there should be no file initially, we let the user figure out what to put in there. Magnus Hagander proposed at the pgconf.dev conference last week that we should ideally ship a complete translation file and maintain it over time, and it should be installed not in pgdata but rather in the install directory. I am not personally able or willing to maintain such a file, I'm only offering to supply the C code to read it and do what it says, but perhaps a group such as the EDB Installer maintainer group, or at least someone with a vested interest in PostgreSQL on Windows, might like to own that job.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-04 00:09 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-05 09:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
@ 2024-06-06 23:39 ` Thomas Munro <thomas.munro@gmail.com>
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Munro @ 2024-06-06 23:39 UTC (permalink / raw)
To: Rahul Pandey <pandeyrah@microsoft.com>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; 🎯dev <targetdev@microsoft.com>
On Wed, Jun 5, 2024 at 9:10 PM Rahul Pandey <pandeyrah@microsoft.com> wrote:
> "Do "Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?"
> You are correct, they all behave in exactly the same way.
> I too would recommend using "tr-TR.1254" since BCP47 tags have a defined structure and this would make the implementation more future proof.
Thanks for confirming. More soon.
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-04 00:09 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-05 09:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
@ 2024-06-13 18:46 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-17 21:06 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
1 sibling, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-06-13 18:46 UTC (permalink / raw)
To: Rahul Pandey <pandeyrah@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; +Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; 🎯dev <targetdev@microsoft.com>
Hi Thomas and Tom,
Just would like to follow up you about the bug. Is there any update? Any other information needed?
Thanks!
Haifang
From: Rahul Pandey <pandeyrah@microsoft.com>
Sent: Wednesday, June 5, 2024 2:11 AM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>
Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; 🎯dev <targetdev@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi,
"Do "Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?"
You are correct, they all behave in exactly the same way.
I too would recommend using "tr-TR.1254" since BCP47 tags have a defined structure and this would make the implementation more future proof.
As for translation files, apologies I neither have a preference nor expertise to comment on this.
________________________________
From: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Sent: Tuesday, June 4, 2024 5:39 AM
To: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Cc: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org> <pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thanks, Thomas. I would leave the questions to Vishwa and Rahul to answer.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Sent: Monday, June 3, 2024 2:22 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Cc: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Jun 4, 2024 at 1:00 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>> wrote:
> Just would like to follow up with you about this bug. Hope Rahul and Vishwa have answered all your questions below. Did you get chance to do investigations? Any other questions?
Hi,
Thanks for all your feedback! Sorry for my late replies, I was travelling and at a conference last week (at which one of the topics was "what are we going to do about the sorry state of PostgreSQL on Windows", but that's a wider topic than this thread...)
The answers are all useful, thank you. There was just one thing I wanted to clarify. Vishwa said:
"Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü"
That sounds like it is answering the question 'Do "Turkish_Turkey.1254" and "Turkish_Türkiye.1254" behave identically?', which I had already assumed to be true, but I was actually asking 'Do ""Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?'. It sounds like the answer is probably yes, but the mention of "u" vs "ü" implied a narrower answer than I was looking for... It's important, because we're proposing to translate to "tr-TR.1254".
Since no one has come forward to test the patch I wrote on Windows, I think my next move will be to try to make a build option that can also do locale name renaming on Unix, so that I have something that I could test myself and push for the next release of PostgreSQL which will be in October.
One open question is whether we should ship a translation file ourselves. I have heard two opinions: Tom Lane proposed in this thread that there should be no file initially, we let the user figure out what to put in there. Magnus Hagander proposed at the pgconf.dev conference last week that we should ideally ship a complete translation file and maintain it over time, and it should be installed not in pgdata but rather in the install directory. I am not personally able or willing to maintain such a file, I'm only offering to supply the C code to read it and do what it says, but perhaps a group such as the EDB Installer maintainer group, or at least someone with a vested interest in PostgreSQL on Windows, might like to own that job.
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-04 00:09 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-05 09:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-06-13 18:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-06-17 21:06 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-24 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-06-17 21:06 UTC (permalink / raw)
To: Rahul Pandey <pandeyrah@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; +Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; 🎯dev <targetdev@microsoft.com>
Hi all,
Still need to double check with you about this bug. How is it going? Any other information needed?
Thanks!
Haifang
From: Haifang Wang (Centific Technologies Inc)
Sent: Thursday, June 13, 2024 11:47 AM
To: Rahul Pandey <pandeyrah@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>
Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; 🎯dev <targetdev@microsoft.com>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi Thomas and Tom,
Just would like to follow up you about the bug. Is there any update? Any other information needed?
Thanks!
Haifang
From: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>
Sent: Wednesday, June 5, 2024 2:11 AM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>; Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>; 🎯dev <targetdev@microsoft.com<mailto:targetdev@microsoft.com>>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi,
"Do "Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?"
You are correct, they all behave in exactly the same way.
I too would recommend using "tr-TR.1254" since BCP47 tags have a defined structure and this would make the implementation more future proof.
As for translation files, apologies I neither have a preference nor expertise to comment on this.
________________________________
From: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Sent: Tuesday, June 4, 2024 5:39 AM
To: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Cc: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org> <pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thanks, Thomas. I would leave the questions to Vishwa and Rahul to answer.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Sent: Monday, June 3, 2024 2:22 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Cc: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Jun 4, 2024 at 1:00 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>> wrote:
> Just would like to follow up with you about this bug. Hope Rahul and Vishwa have answered all your questions below. Did you get chance to do investigations? Any other questions?
Hi,
Thanks for all your feedback! Sorry for my late replies, I was travelling and at a conference last week (at which one of the topics was "what are we going to do about the sorry state of PostgreSQL on Windows", but that's a wider topic than this thread...)
The answers are all useful, thank you. There was just one thing I wanted to clarify. Vishwa said:
"Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü"
That sounds like it is answering the question 'Do "Turkish_Turkey.1254" and "Turkish_Türkiye.1254" behave identically?', which I had already assumed to be true, but I was actually asking 'Do ""Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?'. It sounds like the answer is probably yes, but the mention of "u" vs "ü" implied a narrower answer than I was looking for... It's important, because we're proposing to translate to "tr-TR.1254".
Since no one has come forward to test the patch I wrote on Windows, I think my next move will be to try to make a build option that can also do locale name renaming on Unix, so that I have something that I could test myself and push for the next release of PostgreSQL which will be in October.
One open question is whether we should ship a translation file ourselves. I have heard two opinions: Tom Lane proposed in this thread that there should be no file initially, we let the user figure out what to put in there. Magnus Hagander proposed at the pgconf.dev conference last week that we should ideally ship a complete translation file and maintain it over time, and it should be installed not in pgdata but rather in the install directory. I am not personally able or willing to maintain such a file, I'm only offering to supply the C code to read it and do what it says, but perhaps a group such as the EDB Installer maintainer group, or at least someone with a vested interest in PostgreSQL on Windows, might like to own that job.
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-04 00:09 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-05 09:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-06-13 18:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-17 21:06 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-06-24 22:07 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 0 replies; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-06-24 22:07 UTC (permalink / raw)
To: Rahul Pandey <pandeyrah@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; +Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; 🎯dev <targetdev@microsoft.com>
Hi all,
Still need to double check with you about this bug. How is it going? Any other information needed?
Thanks!
Haifang
From: Haifang Wang (Centific Technologies Inc)
Sent: Monday, June 17, 2024 2:06 PM
To: Rahul Pandey <pandeyrah@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>
Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; 🎯dev <targetdev@microsoft.com>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi all,
Still need to double check with you about this bug. How is it going? Any other information needed?
Thanks!
Haifang
From: Haifang Wang (Centific Technologies Inc)
Sent: Thursday, June 13, 2024 11:47 AM
To: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>; 🎯dev <targetdev@microsoft.com<mailto:targetdev@microsoft.com>>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi Thomas and Tom,
Just would like to follow up you about the bug. Is there any update? Any other information needed?
Thanks!
Haifang
From: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>
Sent: Wednesday, June 5, 2024 2:11 AM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>; Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Cc: Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>; 🎯dev <targetdev@microsoft.com<mailto:targetdev@microsoft.com>>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Hi,
"Do "Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?"
You are correct, they all behave in exactly the same way.
I too would recommend using "tr-TR.1254" since BCP47 tags have a defined structure and this would make the implementation more future proof.
As for translation files, apologies I neither have a preference nor expertise to comment on this.
________________________________
From: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Sent: Tuesday, June 4, 2024 5:39 AM
To: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Cc: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org> <pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Thanks, Thomas. I would leave the questions to Vishwa and Rahul to answer.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>>
Sent: Monday, June 3, 2024 2:22 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>>
Cc: Rahul Pandey <pandeyrah@microsoft.com<mailto:pandeyrah@microsoft.com>>; Vishwa Deepak <Vishwa.Deepak@microsoft.com<mailto:Vishwa.Deepak@microsoft.com>>; Shawn Steele <Shawn.Steele@microsoft.com<mailto:Shawn.Steele@microsoft.com>>; Amy Wishnousky <amyw@microsoft.com<mailto:amyw@microsoft.com>>; Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>; pgsql-bugs@lists.postgresql.org<mailto:pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com<mailto:gulatishweta@microsoft.com>>; Ashish Nawal <nawalashish@microsoft.com<mailto:nawalashish@microsoft.com>>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Jun 4, 2024 at 1:00 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>> wrote:
> Just would like to follow up with you about this bug. Hope Rahul and Vishwa have answered all your questions below. Did you get chance to do investigations? Any other questions?
Hi,
Thanks for all your feedback! Sorry for my late replies, I was travelling and at a conference last week (at which one of the topics was "what are we going to do about the sorry state of PostgreSQL on Windows", but that's a wider topic than this thread...)
The answers are all useful, thank you. There was just one thing I wanted to clarify. Vishwa said:
"Yes, its exactly the same code and driving data , only spelling is changed which included replcement of u with ü"
That sounds like it is answering the question 'Do "Turkish_Turkey.1254" and "Turkish_Türkiye.1254" behave identically?', which I had already assumed to be true, but I was actually asking 'Do ""Turkish_Turkey.1254", "Turkish_Türkiye.1254" and "tr-TR.1254" all behave identically?'. It sounds like the answer is probably yes, but the mention of "u" vs "ü" implied a narrower answer than I was looking for... It's important, because we're proposing to translate to "tr-TR.1254".
Since no one has come forward to test the patch I wrote on Windows, I think my next move will be to try to make a build option that can also do locale name renaming on Unix, so that I have something that I could test myself and push for the next release of PostgreSQL which will be in October.
One open question is whether we should ship a translation file ourselves. I have heard two opinions: Tom Lane proposed in this thread that there should be no file initially, we let the user figure out what to put in there. Magnus Hagander proposed at the pgconf.dev conference last week that we should ideally ship a complete translation file and maintain it over time, and it should be installed not in pgdata but rather in the install directory. I am not personally able or willing to maintain such a file, I'm only offering to supply the C code to read it and do what it says, but perhaps a group such as the EDB Installer maintainer group, or at least someone with a vested interest in PostgreSQL on Windows, might like to own that job.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-06-25 11:51 ` Thomas Munro <thomas.munro@gmail.com>
2024-06-25 22:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-07-05 22:00 ` Windows Application Issues | PostgreSQL | REF # 51961374 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2 siblings, 3 replies; 73+ messages in thread
From: Thomas Munro @ 2024-06-25 11:51 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Tue, Jun 4, 2024 at 9:22 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> Since no one has come forward to test the patch I wrote on Windows, I
> think my next move will be to try to make a build option that can also
> do locale name renaming on Unix, so that I have something that I could
> test myself and push for the next release of PostgreSQL which will be
> in October.
Here is a such a patch. If you go into pg_config_manual.h and
uncomment this line:
/* #define DEBUG_SETLOCALE_MAP */
... then Unix systems will also be able to rename locales passed to
setlocale(). A map file can be provided either by putting its
absolute path into the environment variable PG_SETLOCALE_MAP, or by
installing it as $PREFIX/share/postgresql/setlocale.map. I couldn't
immediately think of a good way to find it in the data directory.
Here's an example of a line that should fix the Turkish problem
(though I haven't tested that, I am not a Windows user):
Turkish_T*.1254=tr-TR.1254
I added some documentation and showed that example.
If you wanted to check it's working on a Unix system, you might try
some lines like *.UTF-8=does_not_exist or en_US.UTF-8=fr_FR.UTF-8 and
then somehow verify that it's using French.
I considered adding win32setlocale.c to the list of files to build for
the port libraries even on Unix, and then wrapping the contents in
#ifdef, but IIUC macOS squawks if you have an empty .c after
preprocessing, so I'd have to add a dummy symbol in there. Or maybe
that'd be better than what I did here, namely including
win32setlocale.c in chklocale.c in this case. Better ideas welcome.
Adding a meson/configure switch to enable it and make the whole .c
file optional seemed excessive.
Attachments:
v2-0001-Make-win32locale.c-s-kludge-table-dynamic.patch (text/x-patch, 19.4K) download
From b98e310a2c22ff0f0a0b6125189a7e7e7dd4b91d Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Tue, 14 May 2024 16:46:27 +1200
Subject: [PATCH v2] Make win32locale.c's kludge table dynamic.
Historically, we transformed Windows' locale names on entry to and exit
from setlocale() using a hard-coded lookup table, because they are
unstable and we can't really handle non-ASCII locale names. We
shouldn't be using these unstable display names, but *setlocale()
itself* gave them to us, and it can't even understand everything it
returns, leading to a series of historical kludges.
Ideally we should soon switch to BCP47 codes for new clusters, but we'll
have to support the older names in ancient database clusters for now and
deal with the transition.
So, provide users with an emergency option for getting unstuck, since
they probably don't want to wait 3-6 months for a new binary with an
updated kludge table when their database fails to come up. While there
are probably workarounds within Windows tools, it seems easy enough to
offer a textfile of name mappings. It might also have applications in
the transition to BCP47.
To help Unix-based developers who couldn't otherwise test this code,
provide a developer-only way to replace setlocale() on Unix too, if the
macro DEBUG_SETLOCALE_MAP is defined.
Discussion: https://postgr.es/m/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.namprd21.prod.outlook.com
---
doc/src/sgml/charset.sgml | 52 +++-
src/include/pg_config_manual.h | 6 +
src/include/port.h | 11 +
src/port/chklocale.c | 7 +
src/port/win32setlocale.c | 402 ++++++++++++++++++++++++-------
src/tools/pgindent/typedefs.list | 1 +
6 files changed, 396 insertions(+), 83 deletions(-)
diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml
index 834cb30c85..62a4f86fde 100644
--- a/doc/src/sgml/charset.sgml
+++ b/doc/src/sgml/charset.sgml
@@ -630,8 +630,58 @@ SELECT 'N-45' < 'N-123' COLLATE mycollation5 as result;
mailing list.
</para>
</sect2>
- </sect1>
+ <sect2 id="locale-windows">
+ <title>Windows locale names</title>
+ <para>
+ Before adopting locale names based on BCP 47 language tags, Windows
+ used names spelled out in full English words. The traditional names are
+ still supported by Windows and PostgreSQL, but are not recommended. They
+ can change unexpectedly in operating system updates, which can cause PostgreSQL to
+ fail. It may have references to the old name in <literal>postgresql.conf</literal>
+ and the <link
+ linkend="catalog-pg-database"><structname>pg_database</structname></link>
+ catalog. They also sometimes have non-ASCII characters, which are
+ not allowed in shared catalog tables.
+ </para>
+ <para>
+ To fix a cluster that is negatively affected by a renamed locale, a mapping
+ file can be installed to rename locales on the fly. Its full path can either
+ be provided in the environment variable <literal>PG_SETLOCALE_MAP</literal>,
+ or in a file named <filename>share/setlocale.map</filename> in the installation
+ directory.
+ </para>
+ <para>
+ Each non-comment line of the file has a pattern and a replacement string
+ separated by an equal sign. The pattern can contain
+ <literal>?</literal> wildcard characters, and optionally a <literal>*</literal>
+ wildcard to match any sequence. The replacement name can be any sort of locale
+ name, including a stable BCP 47 locale name. For example:
+<screen>
+# "Turkish_Turkey.1254" changed to "Turkish_Türkiye.1254" in a Windows update.
+# If either of these names is the database default, convert them to the
+# stable BCP 47 equivalent on the fly. Use a wildcard to detect both
+# names and avoid encoding problems in the name itself.
+Turkish_T*.1254=tr-TR.1254
+</screen>
+ </para>
+ <para>
+ The mapping file is only intended to address renaming problems. Mapping a
+ locale name to an incompatible one could cause index corruption, due to
+ differing collation order.
+ </para>
+ <para>
+ Unless a file is installed by the user, PostgreSQL behaves as though the
+ following file were installed, for historical reasons:
+<screen>
+Hong Kong S.A.R.=HKG
+.A.E.=ARE
+Chinese (Traditional)_Maca? S.A.R..950=ZHM
+Chinese_Maca? S.A.R..950=ZHM
+</screen>
+ </para>
+ </sect2>
+ </sect1>
<sect1 id="collation">
<title>Collation Support</title>
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index f941ee2faf..e04b02908a 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -141,6 +141,12 @@
#define EXEC_BACKEND
#endif
+/*
+ * Define DEBUG_SETLOCALE_MAP to test the setlocale() replacement function on
+ * Unix sytems. Normally it is used only on Windows.
+ */
+/* #define DEBUG_SETLOCALE_MAP */
+
/*
* USE_POSIX_FADVISE controls whether Postgres will attempt to use the
* posix_fadvise() kernel call. Usually the automatic configure tests are
diff --git a/src/include/port.h b/src/include/port.h
index ae115d2d97..0f482391c6 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -501,6 +501,17 @@ extern bool wait_result_is_signal(int exit_status, int signum);
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
extern int wait_result_to_exit_code(int exit_status);
+/*
+ * Debug-only option to allow Unix systems to test the setlocale() replacement
+ * code we use on Windows.
+ */
+#ifdef DEBUG_SETLOCALE_MAP
+/* port/win32setlocale.c */
+#undef setlocale
+extern char *pgwin32_setlocale(int category, const char *locale);
+#define setlocale(a,b) pgwin32_setlocale(a,b)
+#endif
+
/*
* Interfaces that we assume all Unix system have. We retain individual macros
* for better documentation.
diff --git a/src/port/chklocale.c b/src/port/chklocale.c
index 8cb81c8640..7e8bcfbf2d 100644
--- a/src/port/chklocale.c
+++ b/src/port/chklocale.c
@@ -431,3 +431,10 @@ pg_get_encoding_from_locale(const char *ctype, bool write_message)
}
#endif /* (HAVE_LANGINFO_H && CODESET) || WIN32 */
+
+/*
+ * An option allowing Unix developers to test the pgwin32_setlocale() function.
+ */
+#if !defined(WIN32) && defined(DEBUG_SETLOCALE_MAP)
+#include "win32setlocale.c"
+#endif
diff --git a/src/port/win32setlocale.c b/src/port/win32setlocale.c
index 9e2ab8cc3a..490b1ae0d5 100644
--- a/src/port/win32setlocale.c
+++ b/src/port/win32setlocale.c
@@ -36,25 +36,38 @@
#undef setlocale
-struct locale_map
-{
- /*
- * String in locale name to replace. Can be a single string (end is NULL),
- * or separate start and end strings. If two strings are given, the locale
- * name must contain both of them, and everything between them is
- * replaced. This is used for a poor-man's regexp search, allowing
- * replacement of "start.*end".
- */
- const char *locale_name_start;
- const char *locale_name_end;
-
- const char *replacement; /* string to replace the match with */
-};
+#ifndef FRONTEND
+#include "pg_config_paths.h"
+#endif
/*
- * Mappings applied before calling setlocale(), to the argument.
+ * The path of a text file that can be created under PGDATA to override these
+ * rules. It allows locale names to be overridden on input to setlocale, and
+ * on return from setlocale when querying the default. This is intended as an
+ * option of last resort for users whose system becomes unstartable due to an
+ * operating system update that changes a locale name.
+ *
+ * # comments begin a hash sign
+ * call pattern=replacement
+ * return pattern=replacemnt
+ *
+ * The pattern syntax supports ? for any character (really byte), and * for
+ * any sequence, though only one star can be used in the whole pattern.
+ *
+ * The encoding of the file is effectively undefined; setlocale() works with
+ * the current Windows ACP, and PostgreSQL thinks the strings should be ASCII
+ * or some undefined superset. This could lead to some confusion if databases
+ * have different encodings, so it's likely that replacements should use BCP47
+ * tags if possible.
*/
-static const struct locale_map locale_map_argument[] = {
+
+typedef struct Win32LocaleTableEntry
+{
+ const char *pattern;
+ const char *replacement;
+} Win32LocaleTableEntry;
+
+static const Win32LocaleTableEntry default_call_mapping_table[] = {
/*
* "HKG" is listed here:
* http://msdn.microsoft.com/en-us/library/cdax410z%28v=vs.71%29.aspx
@@ -63,8 +76,8 @@ static const struct locale_map locale_map_argument[] = {
* "ARE" is the ISO-3166 three-letter code for U.A.E. It is not on the
* above list, but seems to work anyway.
*/
- {"Hong Kong S.A.R.", NULL, "HKG"},
- {"U.A.E.", NULL, "ARE"},
+ {"Hong Kong S.A.R.", "HKG"},
+ {"U.A.E.", "ARE"},
/*
* The ISO-3166 country code for Macau S.A.R. is MAC, but Windows doesn't
@@ -79,17 +92,13 @@ static const struct locale_map locale_map_argument[] = {
*
* Some versions of Windows spell it "Macau", others "Macao".
*/
- {"Chinese (Traditional)_Macau S.A.R..950", NULL, "ZHM"},
- {"Chinese_Macau S.A.R..950", NULL, "ZHM"},
- {"Chinese (Traditional)_Macao S.A.R..950", NULL, "ZHM"},
- {"Chinese_Macao S.A.R..950", NULL, "ZHM"},
- {NULL, NULL, NULL}
+ {"Chinese (Traditional)_Maca? S.A.R..950", "ZHM"},
+ {"Chinese_Maca? S.A.R..950", "ZHM"},
+
+ {NULL}
};
-/*
- * Mappings applied after calling setlocale(), to its return value.
- */
-static const struct locale_map locale_map_result[] = {
+static const Win32LocaleTableEntry return_mapping_table[] = {
/*
* "Norwegian (Bokmål)" locale name contains the a-ring character.
* Map it to a pure-ASCII alias.
@@ -100,84 +109,309 @@ static const struct locale_map locale_map_result[] = {
* Just to make life even more complicated, some versions of Windows spell
* the locale name without parentheses. Translate that too.
*/
- {"Norwegian (Bokm", "l)_Norway", "Norwegian_Norway"},
- {"Norwegian Bokm", "l_Norway", "Norwegian_Norway"},
- {NULL, NULL, NULL}
+ {"Norwegian (Bokm*l)_Norway", "Norwegian_Norway"},
+ {"Norwegian Bokm*l_Norway", "Norwegian_Norway"},
+
+ {NULL}
};
-#define MAX_LOCALE_NAME_LEN 100
+static const Win32LocaleTableEntry *call_mapping_table;
-static const char *
-map_locale(const struct locale_map *map, const char *locale)
+/*
+ * Parse a line of the mapping file. Returns 0 on success. Squawks to stderr
+ * on failure, but also sets the errno for setlocale() to fail with and
+ * returns -1 in that case.
+ */
+static int
+parse_line(const char *path,
+ char *line,
+ int line_number,
+ char **pattern,
+ char **replacement)
+{
+ const char *delimiter;
+ size_t len;
+
+ /* Strip line endings. */
+ while ((len = strlen(line)) > 0 &&
+ (line[len - 1] == '\r' || line[len - 1] == '\n'))
+ line[len - 1] = '\0';
+
+ /* Skip empty lines and shell-style comments. */
+ if (line[0] == '\0' || line[0] == '#')
+ return 0;
+
+ /* Look for the equal sign followed by something. */
+ delimiter = strchr(line, '=');
+ if (!delimiter || delimiter[1] == '\0')
+ {
+ fprintf(stderr,
+ "syntax error on line %d of \"%s\", expected pattern=replacement'\n",
+ line_number, path);
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Copy the pattern. */
+ len = delimiter - line;
+ *pattern = malloc(len + 1);
+ if (!*pattern)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(*pattern, line, len);
+ (*pattern)[len] = '\0';
+
+ /* Copy the replacement. */
+ *replacement = strdup(delimiter + 1);
+ if (!*replacement)
+ {
+ free(*pattern);
+ errno = ENOMEM;
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * Free a mapping table. Only used for cleanup on failure, because otherwise
+ * the mapping table is built once and sticks around until process exit.
+ */
+static void
+free_call_mapping_table(Win32LocaleTableEntry *table)
+{
+ while (table->pattern)
+ {
+ free(unconstify(char *, table->pattern));
+ free(unconstify(char *, table->replacement));
+ table++;
+ }
+ free(table);
+}
+
+/*
+ * Initialize call_mapping_table and call_mapping_table_size. On failure,
+ * errno is set and an error message is written to stderr.
+ */
+static int
+initialize_call_mapping_table(void)
{
- static char aliasbuf[MAX_LOCALE_NAME_LEN];
- int i;
+ FILE *file;
+ const char *path;
+ char line[128];
+ int line_number;
+ Win32LocaleTableEntry *table;
+ size_t table_size;
+ size_t table_capacity;
+
+ /* Has the user specified a map file in the environment? */
+ path = getenv("PG_SETLOCALE_MAP");
- /* Check if the locale name matches any of the problematic ones. */
- for (i = 0; map[i].locale_name_start != NULL; i++)
+ /*
+ * In backends only, fall back to trying to find a file installed in the
+ * share directory.
+ */
+ if (!path)
{
- const char *needle_start = map[i].locale_name_start;
- const char *needle_end = map[i].locale_name_end;
- const char *replacement = map[i].replacement;
- char *match;
- char *match_start = NULL;
- char *match_end = NULL;
-
- match = strstr(locale, needle_start);
- if (match)
+#ifndef FRONTEND
+ path = PGSHAREDIR "/setlocale.map";
+#else
+ /* Use defaults in frontend. */
+ call_mapping_table = default_call_mapping_table;
+ return 0;
+#endif
+ }
+
+ /* If there is no mapping file at that path, use defaults. */
+ file = fopen(path, "r");
+ if (!file)
+ {
+ call_mapping_table = default_call_mapping_table;
+ return 0;
+ }
+
+ /* Initial guess at required space. */
+ table_size = 0;
+ table_capacity = 16;
+ table = malloc(sizeof(Win32LocaleTableEntry) * table_capacity);
+ if (table == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ table->pattern = NULL;
+
+ /* Read the file line-by-line. */
+ line_number = 0;
+ while (fgets(line, sizeof(line), file))
+ {
+ char *pattern = NULL;
+ char *replacement;
+
+ if (parse_line(path,
+ line,
+ line_number++,
+ &pattern,
+ &replacement) != 0)
{
- /*
- * Found a match for the first part. If this was a two-part
- * replacement, find the second part.
- */
- match_start = match;
- if (needle_end)
- {
- match = strstr(match_start + strlen(needle_start), needle_end);
- if (match)
- match_end = match + strlen(needle_end);
- else
- match_start = NULL;
- }
- else
- match_end = match_start + strlen(needle_start);
+ int save_errno = errno;
+
+ free_call_mapping_table(table);
+ fclose(file);
+ errno = save_errno;
+ return -1;
}
- if (match_start)
+ /* Skip blank/comments. */
+ if (pattern == NULL)
+ continue;
+
+ /*
+ * Grow by doubling on demand. Allow an extra entry because we want a
+ * null terminator.
+ */
+ if (table_size + 1 == table_capacity)
{
- /* Found a match. Replace the matched string. */
- int matchpos = match_start - locale;
- int replacementlen = strlen(replacement);
- char *rest = match_end;
- int restlen = strlen(rest);
-
- /* check that the result fits in the static buffer */
- if (matchpos + replacementlen + restlen + 1 > MAX_LOCALE_NAME_LEN)
- return NULL;
-
- memcpy(&aliasbuf[0], &locale[0], matchpos);
- memcpy(&aliasbuf[matchpos], replacement, replacementlen);
- /* includes null terminator */
- memcpy(&aliasbuf[matchpos + replacementlen], rest, restlen + 1);
-
- return aliasbuf;
+ Win32LocaleTableEntry *new_table;
+
+ new_table = malloc(sizeof(*new_table) * table_capacity * 2);
+ if (new_table == NULL)
+ {
+ free_call_mapping_table(table);
+ fclose(file);
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(new_table, table, sizeof(*table) * table_size);
+ free(table);
+ table = new_table;
+ table_capacity *= 2;
}
+
+ /* Fill in new entry. */
+ table[table_size].pattern = pattern;
+ table[table_size].replacement = replacement;
+ table_size++;
+
+ table[table_size].pattern = NULL;
}
- /* no match, just return the original string */
- return locale;
+ fclose(file);
+
+ /* Mapping table established for this process. */
+ call_mapping_table = table;
+
+ return 0;
}
+/*
+ * Checks if n bytes of pattern and name match. '?' is treated as a wildcard
+ * in the pattern, but all other bytes must be identical to match.
+ */
+static bool
+subpattern_matches(const char *pattern, const char *name, size_t n)
+{
+ while (n > 0)
+ {
+ /* Have we hit the end of the pattern or name? */
+ if (*pattern == '\0')
+ return *name == '\0';
+ else if (*name == '\0')
+ return false;
+
+ /* Otherwise matches wildcard or exact character. */
+ if (*pattern != '?' && *pattern != *name)
+ return false;
+
+ /* Next. */
+ n--;
+ pattern++;
+ name++;
+ }
+ return true;
+}
+
+/*
+ * Checks if a name matches a pattern, with an extremely simple pattern logic.
+ * The pattern may contain any number of '?' characters to match any character,
+ * and zero or one '*' characters to match any sequence of characters.
+ */
+static bool
+pattern_matches(const char *pattern, const char *name)
+{
+ const char *star;
+
+ if ((star = strchr(pattern, '*')))
+ {
+ size_t len_pattern_before_star;
+ size_t len_pattern_after_star;
+ size_t len_name;
+
+ /* Does the name match the part before the star? */
+ len_pattern_before_star = star - pattern;
+ if (!subpattern_matches(pattern, name, len_pattern_before_star))
+ return false;
+
+ /* Step over the star in the pattern. */
+ pattern += len_pattern_before_star;
+ pattern++;
+ len_pattern_after_star = strlen(pattern);
+
+ /* Step over the star in the name. */
+ name += len_pattern_before_star;
+ len_name = strlen(name);
+ if (len_name < len_pattern_after_star)
+ return false;
+ name += len_name - len_pattern_after_star;
+ }
+
+ return subpattern_matches(pattern, name, SIZE_MAX);
+}
+
+/*
+ * Convert a locale name using the given table, if it contains a matching
+ * pattern.
+ */
+static const char *
+map_locale(const Win32LocaleTableEntry *table, const char *name)
+{
+ while (table->pattern)
+ {
+ if (pattern_matches(table->pattern, name))
+ return table->replacement;
+ table++;
+ }
+ return name;
+}
+
+/*
+ * This implementation sets errno and in some cases writes messages to stderr
+ * for catastrophic internal failures, though the POSIX function defines no
+ * errors so callers don't actually check errno.
+ */
char *
pgwin32_setlocale(int category, const char *locale)
{
const char *argument;
char *result;
+ if (!call_mapping_table)
+ {
+ if (initialize_call_mapping_table() < 0)
+ return NULL;
+ }
+
+ /*
+ * XXX Call value transformation is relevant as long as we think there are
+ * existing systems that were initdb'd with unstable and non-ASCII locale
+ * names.
+ */
if (locale == NULL)
argument = NULL;
else
- argument = map_locale(locale_map_argument, locale);
+ argument = map_locale(call_mapping_table, locale);
/* Call the real setlocale() function */
result = setlocale(category, argument);
@@ -185,9 +419,13 @@ pgwin32_setlocale(int category, const char *locale)
/*
* setlocale() is specified to return a "char *" that the caller is
* forbidden to modify, so casting away the "const" is innocuous.
+ *
+ * XXX Return value transformation is only relevant as long as we continue
+ * to use setlocale("") as a way to query the default locale names, which
+ * is the source of the unstable and non-ASCII locale names.
*/
if (result)
- result = unconstify(char *, map_locale(locale_map_result, result));
+ result = unconstify(char *, map_locale(return_mapping_table, result));
return result;
}
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 61ad417cde..2c8626dec4 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -3131,6 +3131,7 @@ WalUsage
WalWriteMethod
WalWriteMethodOps
Walfile
+Win32LocaleTableEntry
WindowAgg
WindowAggPath
WindowAggState
--
2.39.2
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-06-25 22:24 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2 siblings, 0 replies; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-06-25 22:24 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Thanks, Thomas. Will wait for the build option to do further testing.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Tuesday, June 25, 2024 4:52 AM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Jun 4, 2024 at 9:22 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> Since no one has come forward to test the patch I wrote on Windows, I
> think my next move will be to try to make a build option that can also
> do locale name renaming on Unix, so that I have something that I could
> test myself and push for the next release of PostgreSQL which will be
> in October.
Here is a such a patch. If you go into pg_config_manual.h and uncomment this line:
/* #define DEBUG_SETLOCALE_MAP */
... then Unix systems will also be able to rename locales passed to setlocale(). A map file can be provided either by putting its absolute path into the environment variable PG_SETLOCALE_MAP, or by installing it as $PREFIX/share/postgresql/setlocale.map. I couldn't immediately think of a good way to find it in the data directory.
Here's an example of a line that should fix the Turkish problem (though I haven't tested that, I am not a Windows user):
Turkish_T*.1254=tr-TR.1254
I added some documentation and showed that example.
If you wanted to check it's working on a Unix system, you might try some lines like *.UTF-8=does_not_exist or en_US.UTF-8=fr_FR.UTF-8 and then somehow verify that it's using French.
I considered adding win32setlocale.c to the list of files to build for the port libraries even on Unix, and then wrapping the contents in #ifdef, but IIUC macOS squawks if you have an empty .c after preprocessing, so I'd have to add a dummy symbol in there. Or maybe that'd be better than what I did here, namely including win32setlocale.c in chklocale.c in this case. Better ideas welcome.
Adding a meson/configure switch to enable it and make the whole .c file optional seemed excessive.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Windows Application Issues | PostgreSQL | REF # 51961374
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-07-05 22:00 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-07-07 07:16 ` Re: Windows Application Issues | PostgreSQL | REF # 51961374 Thomas Munro <thomas.munro@gmail.com>
2 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-07-05 22:00 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Hi Team,
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. We’re reaching out to notify you of a potential issue in one of your applications.
The issue details are below, please review it when you have a moment. Our goal is to work with you to address this issue and to understand what your expected timeline to address this issue might be. If you have any questions about the details below or have already addressed this issue in a forthcoming update, please let me know.
Account
PostgreSQL Global Development Group
Product
PostgreSQL
Reference #
51961374
Issue
Fail to work with Find and Replace options within the application with latest version of app
Environment: Desktop
OS: Windows 11
Bamboo Paper: 16.3-2
Repro Steps:
1. Deploy OS.
2. Perform WU, enable roles & features.
3. Download the application: PostgreSQL from vendor link .
4. Run the setup file.
5. After the installation, Restart the machine.
6. Launch the PostgreSQL from the start menu.
7. Connect to the database.
8. Go to Tool menu ->click on query tool option.
9. Write the sql query.
10. Click edit option ->Try to work with find and replace options.
11. Observe.
Observations:
Fail to work with Find and Replace options within the application with latest version of app
Expected Results:
Should be able to work with Find and Replace options successfully without any issue.
Resource
For any questions on app development (or) submission on windows, contact Windows Dev Center. https://developer.microsoft.com/en-us/windows/support
Thanks!
Haifang
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: Windows Application Issues | PostgreSQL | REF # 51961374
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-05 22:00 ` Windows Application Issues | PostgreSQL | REF # 51961374 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-07-07 07:16 ` Thomas Munro <thomas.munro@gmail.com>
2024-07-08 15:52 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 51961374 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-07-07 07:16 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Sat, Jul 6, 2024 at 10:00 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Launch the PostgreSQL from the start menu.
> Connect to the database.
> Go to Tool menu ->click on query tool option.
> Write the sql query.
> Click edit option ->Try to work with find and replace options.
Hi Haifang,
It sounds like this might be referring to "pgadmin", a GUI tool for
talking to PostgreSQL? PostgreSQL itself doesn't have a GUI, but the
associated pgadmin project does, and it has its own place for bug
reporting over here:
https://www.pgadmin.org/support/issues/
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 51961374
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-05 22:00 ` Windows Application Issues | PostgreSQL | REF # 51961374 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-07-07 07:16 ` Re: Windows Application Issues | PostgreSQL | REF # 51961374 Thomas Munro <thomas.munro@gmail.com>
@ 2024-07-08 15:52 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 0 replies; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-07-08 15:52 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Thanks a lot for pointing this out, Thomas. I will report the issue to pgadmin.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Sunday, July 7, 2024 12:17 AM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org
Subject: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 51961374
On Sat, Jul 6, 2024 at 10:00 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Launch the PostgreSQL from the start menu.
> Connect to the database.
> Go to Tool menu ->click on query tool option.
> Write the sql query.
> Click edit option ->Try to work with find and replace options.
Hi Haifang,
It sounds like this might be referring to "pgadmin", a GUI tool for talking to PostgreSQL? PostgreSQL itself doesn't have a GUI, but the associated pgadmin project does, and it has its own place for bug reporting over here:
https://www.pgadmin.org/support/issues/
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-07-21 11:54 ` Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-07-21 11:54 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
A minor release deadline is only a couple of weeks away and
unfortunately we still have no confirmation from a Windows user that
this technique can be used to unbreak a database cluster that actually
goes though that exact upgrade sequence. So I spent today figuring
out how to write a TAP test to try to convince myself of that in the
abstract. No C code change from v2. Does the test show a useful
enough pathway that is likely to help people in future cases at least?
I learned two new things:
1. With a remapped locale, you can log into your existing databases
again, but CREATE DATABASE doesn't work (see test). That must have
been the case for the historical transitions that were hard-coded
(Macau etc); this is no different, it's just that the mapping table is
now user-changeable. In other words, this just gives an administrator
a way to log into a cluster again after such a change, but then they
really need to update the names in catalogs, at least for any database
that might be used as a template, to get a 100% functional system. So
I have added a paragraph to the documentation piece to explain that.
2. Including the encoding suffix eg "en-US.1252" doesn't actually
work after all (discovered by CI). You have to use just "en-US". (I
guess ".UTF-8" must be a special case.) So I have updated the
documentation example.
Attachments: download all (2 files, .tar.gz)
v3-0001-Make-win32locale.c-s-kludge-table-dynamic.patch (text/x-patch, 26.2K) download
From 6bb1e9ed7640c227be47831204fbec81563fb938 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Tue, 14 May 2024 16:46:27 +1200
Subject: [PATCH v3 1/2] Make win32locale.c's kludge table dynamic.
Historically, we transformed Windows' locale names on entry to and exit
from setlocale() using a hard-coded lookup table, because they are
unstable and we can't really handle non-ASCII locale names. We
shouldn't be using these unstable display names, but *setlocale()
itself* gave them to us, and it can't even understand everything it
returns, leading to a series of historical kludges.
Ideally we should soon switch to BCP47 codes for new clusters, but we'll
have to support the older names in ancient database clusters for now and
deal with the transition.
So, provide users with an emergency option for getting unstuck, since
they probably don't want to wait 3-6 months for a new binary with an
updated kludge table when their database fails to come up. While there
are probably workarounds within Windows tools, it seems easy enough to
offer a textfile of name mappings. It might also have applications in
the transition to BCP47.
To help Unix-based developers who couldn't otherwise test this code,
provide a developer-only way to replace setlocale() on Unix too, if the
macro DEBUG_SETLOCALE_MAP is defined, and run the test if PG_EXTRA_TESTS
contains DEBUG_SETLOCALE_MAP.
Discussion: https://postgr.es/m/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.namprd21.prod.outlook.com
---
doc/src/sgml/charset.sgml | 58 ++-
src/include/pg_config_manual.h | 6 +
src/include/port.h | 11 +
src/port/chklocale.c | 7 +
src/port/win32setlocale.c | 402 ++++++++++++++----
src/test/modules/test_misc/meson.build | 1 +
.../modules/test_misc/t/007_setlocale_map.pl | 154 +++++++
src/tools/pgindent/typedefs.list | 1 +
8 files changed, 557 insertions(+), 83 deletions(-)
create mode 100644 src/test/modules/test_misc/t/007_setlocale_map.pl
diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml
index 834cb30c85..5c0e275108 100644
--- a/doc/src/sgml/charset.sgml
+++ b/doc/src/sgml/charset.sgml
@@ -630,8 +630,64 @@ SELECT 'N-45' < 'N-123' COLLATE mycollation5 as result;
mailing list.
</para>
</sect2>
- </sect1>
+ <sect2 id="locale-windows">
+ <title>Windows locale names</title>
+ <para>
+ Before adopting BCP 47 language tags, Windows used names spelled out in
+ full English words. The traditional names are still supported by Windows
+ and PostgreSQL, but are not recommended. They can change unexpectedly in
+ operating system updates, which can cause PostgreSQL to fail to start. It
+ may have references to the old name in
+ <literal>postgresql.conf</literal> and the <link
+ linkend="catalog-pg-database"><structname>pg_database</structname></link>
+ catalog. The old names also sometimes contain non-ASCII characters, which
+ are not allowed in shared catalog tables.
+ </para>
+ <para>
+ To be able to log into a cluster after the operating system has stopped
+ recognizing a locale name, a mapping file can be installed to redirect the
+ locale to a new name on the fly. Its full path can either be provided in
+ the environment variable <literal>PG_SETLOCALE_MAP</literal>, or in a file
+ named <filename>share/setlocale.map</filename> in the installation
+ directory.
+ </para>
+ <para>
+ Each non-comment line of the file has a pattern and a replacement string
+ separated by an equal sign. The pattern can contain
+ <literal>?</literal> wildcard characters, and optionally a <literal>*</literal>
+ wildcard to match any sequence. The replacement name can be any sort of locale
+ name, including a stable BCP 47 locale name. For example:
+<screen>
+# "Turkish_Turkey.1254" changed to "Turkish_Türkiye.1254" in a Windows update.
+# If either of these names is the database default, convert them to the
+# stable BCP 47 equivalent on the fly. Use a wildcard to detect both
+# names and avoid encoding problems in the name itself.
+Turkish_T*.1254=tr-TR
+</screen>
+ </para>
+ <para>
+ Locale mapping files provide a migration pathway when a locale's name has
+ changed. The replacement name should be a name for the "same" locale, or
+ indexes might become corrupted. Once an affected cluster has been made
+ operational with the help of a mapping file, references to the locale
+ should ideally be updated to the new name. This must be done in the
+ <link linkend="catalog-pg-database"><structname>pg_database</structname></link>
+ catalog by direct <command>UPDATE</command>, to avoid problems creating
+ new databases from template databases due to mismatching locale names.
+ </para>
+ <para>
+ Unless a file is installed by the user, PostgreSQL behaves as though the
+ following file were installed, for historical reasons:
+<screen>
+Hong Kong S.A.R.=HKG
+U.A.E.=ARE
+Chinese (Traditional)_Maca? S.A.R..950=ZHM
+Chinese_Maca? S.A.R..950=ZHM
+</screen>
+ </para>
+ </sect2>
+ </sect1>
<sect1 id="collation">
<title>Collation Support</title>
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index f941ee2faf..e04b02908a 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -141,6 +141,12 @@
#define EXEC_BACKEND
#endif
+/*
+ * Define DEBUG_SETLOCALE_MAP to test the setlocale() replacement function on
+ * Unix sytems. Normally it is used only on Windows.
+ */
+/* #define DEBUG_SETLOCALE_MAP */
+
/*
* USE_POSIX_FADVISE controls whether Postgres will attempt to use the
* posix_fadvise() kernel call. Usually the automatic configure tests are
diff --git a/src/include/port.h b/src/include/port.h
index ae115d2d97..0f482391c6 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -501,6 +501,17 @@ extern bool wait_result_is_signal(int exit_status, int signum);
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
extern int wait_result_to_exit_code(int exit_status);
+/*
+ * Debug-only option to allow Unix systems to test the setlocale() replacement
+ * code we use on Windows.
+ */
+#ifdef DEBUG_SETLOCALE_MAP
+/* port/win32setlocale.c */
+#undef setlocale
+extern char *pgwin32_setlocale(int category, const char *locale);
+#define setlocale(a,b) pgwin32_setlocale(a,b)
+#endif
+
/*
* Interfaces that we assume all Unix system have. We retain individual macros
* for better documentation.
diff --git a/src/port/chklocale.c b/src/port/chklocale.c
index 8cb81c8640..7e8bcfbf2d 100644
--- a/src/port/chklocale.c
+++ b/src/port/chklocale.c
@@ -431,3 +431,10 @@ pg_get_encoding_from_locale(const char *ctype, bool write_message)
}
#endif /* (HAVE_LANGINFO_H && CODESET) || WIN32 */
+
+/*
+ * An option allowing Unix developers to test the pgwin32_setlocale() function.
+ */
+#if !defined(WIN32) && defined(DEBUG_SETLOCALE_MAP)
+#include "win32setlocale.c"
+#endif
diff --git a/src/port/win32setlocale.c b/src/port/win32setlocale.c
index 9e2ab8cc3a..490b1ae0d5 100644
--- a/src/port/win32setlocale.c
+++ b/src/port/win32setlocale.c
@@ -36,25 +36,38 @@
#undef setlocale
-struct locale_map
-{
- /*
- * String in locale name to replace. Can be a single string (end is NULL),
- * or separate start and end strings. If two strings are given, the locale
- * name must contain both of them, and everything between them is
- * replaced. This is used for a poor-man's regexp search, allowing
- * replacement of "start.*end".
- */
- const char *locale_name_start;
- const char *locale_name_end;
-
- const char *replacement; /* string to replace the match with */
-};
+#ifndef FRONTEND
+#include "pg_config_paths.h"
+#endif
/*
- * Mappings applied before calling setlocale(), to the argument.
+ * The path of a text file that can be created under PGDATA to override these
+ * rules. It allows locale names to be overridden on input to setlocale, and
+ * on return from setlocale when querying the default. This is intended as an
+ * option of last resort for users whose system becomes unstartable due to an
+ * operating system update that changes a locale name.
+ *
+ * # comments begin a hash sign
+ * call pattern=replacement
+ * return pattern=replacemnt
+ *
+ * The pattern syntax supports ? for any character (really byte), and * for
+ * any sequence, though only one star can be used in the whole pattern.
+ *
+ * The encoding of the file is effectively undefined; setlocale() works with
+ * the current Windows ACP, and PostgreSQL thinks the strings should be ASCII
+ * or some undefined superset. This could lead to some confusion if databases
+ * have different encodings, so it's likely that replacements should use BCP47
+ * tags if possible.
*/
-static const struct locale_map locale_map_argument[] = {
+
+typedef struct Win32LocaleTableEntry
+{
+ const char *pattern;
+ const char *replacement;
+} Win32LocaleTableEntry;
+
+static const Win32LocaleTableEntry default_call_mapping_table[] = {
/*
* "HKG" is listed here:
* http://msdn.microsoft.com/en-us/library/cdax410z%28v=vs.71%29.aspx
@@ -63,8 +76,8 @@ static const struct locale_map locale_map_argument[] = {
* "ARE" is the ISO-3166 three-letter code for U.A.E. It is not on the
* above list, but seems to work anyway.
*/
- {"Hong Kong S.A.R.", NULL, "HKG"},
- {"U.A.E.", NULL, "ARE"},
+ {"Hong Kong S.A.R.", "HKG"},
+ {"U.A.E.", "ARE"},
/*
* The ISO-3166 country code for Macau S.A.R. is MAC, but Windows doesn't
@@ -79,17 +92,13 @@ static const struct locale_map locale_map_argument[] = {
*
* Some versions of Windows spell it "Macau", others "Macao".
*/
- {"Chinese (Traditional)_Macau S.A.R..950", NULL, "ZHM"},
- {"Chinese_Macau S.A.R..950", NULL, "ZHM"},
- {"Chinese (Traditional)_Macao S.A.R..950", NULL, "ZHM"},
- {"Chinese_Macao S.A.R..950", NULL, "ZHM"},
- {NULL, NULL, NULL}
+ {"Chinese (Traditional)_Maca? S.A.R..950", "ZHM"},
+ {"Chinese_Maca? S.A.R..950", "ZHM"},
+
+ {NULL}
};
-/*
- * Mappings applied after calling setlocale(), to its return value.
- */
-static const struct locale_map locale_map_result[] = {
+static const Win32LocaleTableEntry return_mapping_table[] = {
/*
* "Norwegian (Bokmål)" locale name contains the a-ring character.
* Map it to a pure-ASCII alias.
@@ -100,84 +109,309 @@ static const struct locale_map locale_map_result[] = {
* Just to make life even more complicated, some versions of Windows spell
* the locale name without parentheses. Translate that too.
*/
- {"Norwegian (Bokm", "l)_Norway", "Norwegian_Norway"},
- {"Norwegian Bokm", "l_Norway", "Norwegian_Norway"},
- {NULL, NULL, NULL}
+ {"Norwegian (Bokm*l)_Norway", "Norwegian_Norway"},
+ {"Norwegian Bokm*l_Norway", "Norwegian_Norway"},
+
+ {NULL}
};
-#define MAX_LOCALE_NAME_LEN 100
+static const Win32LocaleTableEntry *call_mapping_table;
-static const char *
-map_locale(const struct locale_map *map, const char *locale)
+/*
+ * Parse a line of the mapping file. Returns 0 on success. Squawks to stderr
+ * on failure, but also sets the errno for setlocale() to fail with and
+ * returns -1 in that case.
+ */
+static int
+parse_line(const char *path,
+ char *line,
+ int line_number,
+ char **pattern,
+ char **replacement)
+{
+ const char *delimiter;
+ size_t len;
+
+ /* Strip line endings. */
+ while ((len = strlen(line)) > 0 &&
+ (line[len - 1] == '\r' || line[len - 1] == '\n'))
+ line[len - 1] = '\0';
+
+ /* Skip empty lines and shell-style comments. */
+ if (line[0] == '\0' || line[0] == '#')
+ return 0;
+
+ /* Look for the equal sign followed by something. */
+ delimiter = strchr(line, '=');
+ if (!delimiter || delimiter[1] == '\0')
+ {
+ fprintf(stderr,
+ "syntax error on line %d of \"%s\", expected pattern=replacement'\n",
+ line_number, path);
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Copy the pattern. */
+ len = delimiter - line;
+ *pattern = malloc(len + 1);
+ if (!*pattern)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(*pattern, line, len);
+ (*pattern)[len] = '\0';
+
+ /* Copy the replacement. */
+ *replacement = strdup(delimiter + 1);
+ if (!*replacement)
+ {
+ free(*pattern);
+ errno = ENOMEM;
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * Free a mapping table. Only used for cleanup on failure, because otherwise
+ * the mapping table is built once and sticks around until process exit.
+ */
+static void
+free_call_mapping_table(Win32LocaleTableEntry *table)
+{
+ while (table->pattern)
+ {
+ free(unconstify(char *, table->pattern));
+ free(unconstify(char *, table->replacement));
+ table++;
+ }
+ free(table);
+}
+
+/*
+ * Initialize call_mapping_table and call_mapping_table_size. On failure,
+ * errno is set and an error message is written to stderr.
+ */
+static int
+initialize_call_mapping_table(void)
{
- static char aliasbuf[MAX_LOCALE_NAME_LEN];
- int i;
+ FILE *file;
+ const char *path;
+ char line[128];
+ int line_number;
+ Win32LocaleTableEntry *table;
+ size_t table_size;
+ size_t table_capacity;
+
+ /* Has the user specified a map file in the environment? */
+ path = getenv("PG_SETLOCALE_MAP");
- /* Check if the locale name matches any of the problematic ones. */
- for (i = 0; map[i].locale_name_start != NULL; i++)
+ /*
+ * In backends only, fall back to trying to find a file installed in the
+ * share directory.
+ */
+ if (!path)
{
- const char *needle_start = map[i].locale_name_start;
- const char *needle_end = map[i].locale_name_end;
- const char *replacement = map[i].replacement;
- char *match;
- char *match_start = NULL;
- char *match_end = NULL;
-
- match = strstr(locale, needle_start);
- if (match)
+#ifndef FRONTEND
+ path = PGSHAREDIR "/setlocale.map";
+#else
+ /* Use defaults in frontend. */
+ call_mapping_table = default_call_mapping_table;
+ return 0;
+#endif
+ }
+
+ /* If there is no mapping file at that path, use defaults. */
+ file = fopen(path, "r");
+ if (!file)
+ {
+ call_mapping_table = default_call_mapping_table;
+ return 0;
+ }
+
+ /* Initial guess at required space. */
+ table_size = 0;
+ table_capacity = 16;
+ table = malloc(sizeof(Win32LocaleTableEntry) * table_capacity);
+ if (table == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ table->pattern = NULL;
+
+ /* Read the file line-by-line. */
+ line_number = 0;
+ while (fgets(line, sizeof(line), file))
+ {
+ char *pattern = NULL;
+ char *replacement;
+
+ if (parse_line(path,
+ line,
+ line_number++,
+ &pattern,
+ &replacement) != 0)
{
- /*
- * Found a match for the first part. If this was a two-part
- * replacement, find the second part.
- */
- match_start = match;
- if (needle_end)
- {
- match = strstr(match_start + strlen(needle_start), needle_end);
- if (match)
- match_end = match + strlen(needle_end);
- else
- match_start = NULL;
- }
- else
- match_end = match_start + strlen(needle_start);
+ int save_errno = errno;
+
+ free_call_mapping_table(table);
+ fclose(file);
+ errno = save_errno;
+ return -1;
}
- if (match_start)
+ /* Skip blank/comments. */
+ if (pattern == NULL)
+ continue;
+
+ /*
+ * Grow by doubling on demand. Allow an extra entry because we want a
+ * null terminator.
+ */
+ if (table_size + 1 == table_capacity)
{
- /* Found a match. Replace the matched string. */
- int matchpos = match_start - locale;
- int replacementlen = strlen(replacement);
- char *rest = match_end;
- int restlen = strlen(rest);
-
- /* check that the result fits in the static buffer */
- if (matchpos + replacementlen + restlen + 1 > MAX_LOCALE_NAME_LEN)
- return NULL;
-
- memcpy(&aliasbuf[0], &locale[0], matchpos);
- memcpy(&aliasbuf[matchpos], replacement, replacementlen);
- /* includes null terminator */
- memcpy(&aliasbuf[matchpos + replacementlen], rest, restlen + 1);
-
- return aliasbuf;
+ Win32LocaleTableEntry *new_table;
+
+ new_table = malloc(sizeof(*new_table) * table_capacity * 2);
+ if (new_table == NULL)
+ {
+ free_call_mapping_table(table);
+ fclose(file);
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(new_table, table, sizeof(*table) * table_size);
+ free(table);
+ table = new_table;
+ table_capacity *= 2;
}
+
+ /* Fill in new entry. */
+ table[table_size].pattern = pattern;
+ table[table_size].replacement = replacement;
+ table_size++;
+
+ table[table_size].pattern = NULL;
}
- /* no match, just return the original string */
- return locale;
+ fclose(file);
+
+ /* Mapping table established for this process. */
+ call_mapping_table = table;
+
+ return 0;
}
+/*
+ * Checks if n bytes of pattern and name match. '?' is treated as a wildcard
+ * in the pattern, but all other bytes must be identical to match.
+ */
+static bool
+subpattern_matches(const char *pattern, const char *name, size_t n)
+{
+ while (n > 0)
+ {
+ /* Have we hit the end of the pattern or name? */
+ if (*pattern == '\0')
+ return *name == '\0';
+ else if (*name == '\0')
+ return false;
+
+ /* Otherwise matches wildcard or exact character. */
+ if (*pattern != '?' && *pattern != *name)
+ return false;
+
+ /* Next. */
+ n--;
+ pattern++;
+ name++;
+ }
+ return true;
+}
+
+/*
+ * Checks if a name matches a pattern, with an extremely simple pattern logic.
+ * The pattern may contain any number of '?' characters to match any character,
+ * and zero or one '*' characters to match any sequence of characters.
+ */
+static bool
+pattern_matches(const char *pattern, const char *name)
+{
+ const char *star;
+
+ if ((star = strchr(pattern, '*')))
+ {
+ size_t len_pattern_before_star;
+ size_t len_pattern_after_star;
+ size_t len_name;
+
+ /* Does the name match the part before the star? */
+ len_pattern_before_star = star - pattern;
+ if (!subpattern_matches(pattern, name, len_pattern_before_star))
+ return false;
+
+ /* Step over the star in the pattern. */
+ pattern += len_pattern_before_star;
+ pattern++;
+ len_pattern_after_star = strlen(pattern);
+
+ /* Step over the star in the name. */
+ name += len_pattern_before_star;
+ len_name = strlen(name);
+ if (len_name < len_pattern_after_star)
+ return false;
+ name += len_name - len_pattern_after_star;
+ }
+
+ return subpattern_matches(pattern, name, SIZE_MAX);
+}
+
+/*
+ * Convert a locale name using the given table, if it contains a matching
+ * pattern.
+ */
+static const char *
+map_locale(const Win32LocaleTableEntry *table, const char *name)
+{
+ while (table->pattern)
+ {
+ if (pattern_matches(table->pattern, name))
+ return table->replacement;
+ table++;
+ }
+ return name;
+}
+
+/*
+ * This implementation sets errno and in some cases writes messages to stderr
+ * for catastrophic internal failures, though the POSIX function defines no
+ * errors so callers don't actually check errno.
+ */
char *
pgwin32_setlocale(int category, const char *locale)
{
const char *argument;
char *result;
+ if (!call_mapping_table)
+ {
+ if (initialize_call_mapping_table() < 0)
+ return NULL;
+ }
+
+ /*
+ * XXX Call value transformation is relevant as long as we think there are
+ * existing systems that were initdb'd with unstable and non-ASCII locale
+ * names.
+ */
if (locale == NULL)
argument = NULL;
else
- argument = map_locale(locale_map_argument, locale);
+ argument = map_locale(call_mapping_table, locale);
/* Call the real setlocale() function */
result = setlocale(category, argument);
@@ -185,9 +419,13 @@ pgwin32_setlocale(int category, const char *locale)
/*
* setlocale() is specified to return a "char *" that the caller is
* forbidden to modify, so casting away the "const" is innocuous.
+ *
+ * XXX Return value transformation is only relevant as long as we continue
+ * to use setlocale("") as a way to query the default locale names, which
+ * is the source of the unstable and non-ASCII locale names.
*/
if (result)
- result = unconstify(char *, map_locale(locale_map_result, result));
+ result = unconstify(char *, map_locale(return_mapping_table, result));
return result;
}
diff --git a/src/test/modules/test_misc/meson.build b/src/test/modules/test_misc/meson.build
index 283ffa751a..a7d3c2b665 100644
--- a/src/test/modules/test_misc/meson.build
+++ b/src/test/modules/test_misc/meson.build
@@ -15,6 +15,7 @@ tests += {
't/004_io_direct.pl',
't/005_timeouts.pl',
't/006_signal_autovacuum.pl',
+ 't/007_setlocale_map.pl',
],
},
}
diff --git a/src/test/modules/test_misc/t/007_setlocale_map.pl b/src/test/modules/test_misc/t/007_setlocale_map.pl
new file mode 100644
index 0000000000..f1dc93dee2
--- /dev/null
+++ b/src/test/modules/test_misc/t/007_setlocale_map.pl
@@ -0,0 +1,154 @@
+
+# Copyright (c) 2024, PostgreSQL Global Development Group
+
+# Test of the PG_SETLOCALE_MAP mechanism for renaming locales on the fly. This
+# always runs on Windows. It is usually skipped on Unix.
+
+# For the benefit of Unix-based developers, it also runs if PG_TEST_EXTRA
+# contains DEBUG_SETLOCALE_MAP, and is expected to pass only if PostgreSQL was
+# compiled with the macro DEBUG_SETLOCALE_MAP defined (see pg_config_manual.h).
+# In that case, locales "en_US.UTF-8" and "fr_FR.UTF-8" are assumed to exist,
+# which may require extra system packages on some systems.
+
+# The assumption this test makes about locales is that "C" sorts lower case
+# before upper case (this is true by definition), while natural language
+# locales do not (true in practice).
+
+use strict;
+use warnings FATAL => 'all';
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
+use Test::More;
+
+if ($^O ne 'MSWin32' && $ENV{PG_TEST_EXTRA} !~ /\bDEBUG_SETLOCALE_MAP\b/)
+{
+ plan skip_all =>
+ 'setlocale mapping on non-Windows requires DEBUG_SETLOCALE_MAP';
+}
+
+my ($ENCODING, $LOCALE1, $LOCALE2, $LOCALE1_PATTERN);
+
+if ($^O eq 'MSWin32')
+{
+ # the purpose of this facility is to deal with changes in the spelling of
+ # the locale name, by allowing people a way to transition to BCP 47 names,
+ # so we'll use that in our example
+ $ENCODING = 'WIN1252';
+ $LOCALE1 = 'English_United States.1252';
+ $LOCALE2 = 'en-US';
+ $LOCALE1_PATTERN = 'English_*.1252';
+}
+else
+{
+ # when testing on Unix, we don't expect there to be another way to spell
+ # the same locale so we'll just pick another language (normally you would
+ # never want to do this)
+ $ENCODING = 'UTF8';
+ $LOCALE1 = 'en_US.UTF-8';
+ $LOCALE2 = 'fr_FR.UTF-8';
+ $LOCALE1_PATTERN = 'en_*.UTF-8';
+}
+
+my $PG_SETLOCALE_MAP =
+ $PostgreSQL::Test::Utils::tmp_check . "/my_setlocale.map";
+$ENV{PG_SETLOCALE_MAP} = $PG_SETLOCALE_MAP;
+$ENV{PG_TEST_INITDB_EXTRA_OPTS} = "--locale='$LOCALE1' --encoding=$ENCODING";
+
+sub install_setlocale_map
+{
+ my $contents = shift;
+ open my $f, ">", $PG_SETLOCALE_MAP or die $!;
+ print $f $contents;
+ close $f;
+}
+
+my $node = PostgreSQL::Test::Cluster->new('main');
+$node->init(force_initdb => 1);
+$node->append_conf('postgresql.conf', 'lc_messages=C');
+$node->append_conf('postgresql.conf', 'lc_monetary=C');
+$node->append_conf('postgresql.conf', 'lc_numeric=C');
+$node->append_conf('postgresql.conf', 'lc_time=C');
+
+$node->start;
+is( 't',
+ $node->safe_psql('postgres', "select 'Z' > 'a'"),
+ "natural language order");
+$node->stop;
+
+# install some non-matching mapping rules, see that nothing changes
+install_setlocale_map <<"EOF";
+foo*=C
+EOF
+
+$node->start;
+is( 't',
+ $node->safe_psql('postgres', "select 'Z' > 'a'"),
+ "still natural language order");
+$node->stop;
+
+# install some matching mapping rules that will give us "C"; use the pattern
+# format just to exercise the pattern matching code
+install_setlocale_map <<"EOF";
+$LOCALE1_PATTERN=C
+EOF
+
+$node->start;
+is('t', $node->safe_psql('postgres', "select 'a' > 'Z'"), "encoding order");
+$node->stop;
+
+# install a mapping to a second natural language, and check that we can
+# create a database from template0
+install_setlocale_map <<"EOF";
+$LOCALE1=$LOCALE2
+EOF
+
+$node->start;
+is( 't',
+ $node->safe_psql('postgres', "select 'Z' > 'a'"),
+ "natural language order via second locale name");
+$node->safe_psql('postgres',
+ "create database regression_db2 template=template0");
+
+# unfortunately we can't create a database from the default template1
+# because now the locale names don't match!
+is( 't',
+ $node->safe_psql('postgres', "select 'Z' > 'a'"),
+ "natural language order via second locale name");
+my ($result, $stdout, $stderr) =
+ $node->psql('postgres', "create database regression_db3");
+ok( $stderr =~
+ /ERROR: new collation \($LOCALE2\) is incompatible with the collation of the template database \($LOCALE1\)/,
+ "cannot create new database because of locale mismatch with template1");
+
+# it's the same even if we explicitly give the locale name, old or new
+($result, $stdout, $stderr) =
+ $node->psql('postgres', "create database regression_db3 locale='$LOCALE1'");
+ok( $stderr =~
+ /ERROR: new collation \($LOCALE2\) is incompatible with the collation of the template database \($LOCALE1\)/,
+ "cannot create new database because of locale mismatch with template1, explicit old"
+);
+($result, $stdout, $stderr) =
+ $node->psql('postgres', "create database regression_db3 locale='$LOCALE2'");
+ok( $stderr =~
+ /ERROR: new collation \($LOCALE2\) is incompatible with the collation of the template database \($LOCALE1\)/,
+ "cannot create new database because of locale mismatch with template1, explicit new"
+);
+
+# to fix that problem we have to do the renaming in the catalog (note that the
+# mapping file still did something very useful by letting us log in to do this,
+# in the case where $LOCALE1 is no longer recognized by the OS)
+$node->safe_psql('postgres',
+ "update pg_database set datcollate = '$LOCALE2' where datlocprovider = 'c' and datcollate = '$LOCALE1'"
+);
+$node->safe_psql('postgres',
+ "update pg_database set datctype = '$LOCALE2' where datlocprovider = 'c' and datctype = '$LOCALE1'"
+);
+
+# now it should work, and we don't really need the mapping file anymore except
+# to deal with uses of the old name in postgresql.conf
+$node->safe_psql('postgres', "create database regression_db3");
+
+$node->stop;
+
+
+done_testing();
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index b4d7f9217c..7cb69c4945 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -3135,6 +3135,7 @@ WalUsage
WalWriteMethod
WalWriteMethodOps
Walfile
+Win32LocaleTableEntry
WindowAgg
WindowAggPath
WindowAggState
--
2.39.2
v3-0002-ci-Enable-DEBUG_SETLOCALE_MAP-on-FreeBSD-task.patch (text/x-patch, 1.5K) download
From acb527c2adb2fc6527513d4d81b8d9609d18d800 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Sun, 21 Jul 2024 15:44:10 +1200
Subject: [PATCH v3 2/2] ci: Enable DEBUG_SETLOCALE_MAP on FreeBSD task.
The 007_setlocale_map.pl test runs automatically on Windows, but it can
also be exercised on Unixoid systems with a special build option. Do
that on the FreeBSD task, so we can make sure it works. On other
Unixen, it will be skipped.
---
.cirrus.tasks.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 99ca74d513..8bd057eaf8 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -133,7 +133,7 @@ task:
DISK_SIZE: 50
CCACHE_DIR: /tmp/ccache_dir
- CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DCOPY_PARSE_PLAN_TREES -DWRITE_READ_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
+ CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DCOPY_PARSE_PLAN_TREES -DWRITE_READ_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS -DDEBUG_SETLOCALE_MAP
CFLAGS: -Og -ggdb
PG_TEST_PG_UPGRADE_MODE: --link
@@ -174,7 +174,7 @@ task:
--buildtype=debug \
-Dcassert=true -Dinjection_points=true \
-Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
- -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
+ -DPG_TEST_EXTRA="$PG_TEST_EXTRA DEBUG_SETLOCALE_MAP" \
-Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
build
EOF
--
2.39.2
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-07-21 13:28 ` Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Andrew Dunstan @ 2024-07-21 13:28 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On 2024-07-21 Su 7:54 AM, Thomas Munro wrote:
> A minor release deadline is only a couple of weeks away and
> unfortunately we still have no confirmation from a Windows user that
> this technique can be used to unbreak a database cluster that actually
> goes though that exact upgrade sequence. So I spent today figuring
> out how to write a TAP test to try to convince myself of that in the
> abstract. No C code change from v2. Does the test show a useful
> enough pathway that is likely to help people in future cases at least?
>
> I learned two new things:
>
> 1. With a remapped locale, you can log into your existing databases
> again, but CREATE DATABASE doesn't work (see test). That must have
> been the case for the historical transitions that were hard-coded
> (Macau etc); this is no different, it's just that the mapping table is
> now user-changeable. In other words, this just gives an administrator
> a way to log into a cluster again after such a change, but then they
> really need to update the names in catalogs, at least for any database
> that might be used as a template, to get a 100% functional system. So
> I have added a paragraph to the documentation piece to explain that.
>
> 2. Including the encoding suffix eg "en-US.1252" doesn't actually
> work after all (discovered by CI). You have to use just "en-US". (I
> guess ".UTF-8" must be a special case.) So I have updated the
> documentation example.
I don't have a general comment, at least yet, but a couple, mostly
stylistic, on your TAP test.
change
if ($^O eq 'MSWin32')
to
if ($windows_os)
Also your use of "is()" is unidiomatic. The expected value should come
after the received value, not before. While your use won't change the
success or failure of the result, the message on failure will be at best
confusing. (I ran into this the other day, so it's fresh in my memory).
See Test::More documentation.
Using all upper case for variables is not our usual perl style (or
anybody else's that I am aware of). Mostly we just use lower case with
underscores. If you use the "constant" module upper case letters are
usually used, but then the things defined are bare words, and come with
some caveats, and I don't think you want to use it here.
The substance of the test looks good.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
@ 2024-07-21 22:00 ` Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-07-21 22:00 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Mon, Jul 22, 2024 at 1:28 AM Andrew Dunstan <andrew@dunslane.net> wrote:
> change
>
> if ($^O eq 'MSWin32')
>
> to
>
> if ($windows_os)
Done.
> Also your use of "is()" is unidiomatic. The expected value should come
> after the received value, not before. While your use won't change the
> success or failure of the result, the message on failure will be at best
> confusing. (I ran into this the other day, so it's fresh in my memory).
> See Test::More documentation.
Fixed.
> Using all upper case for variables is not our usual perl style (or
> anybody else's that I am aware of). Mostly we just use lower case with
> underscores. If you use the "constant" module upper case letters are
> usually used, but then the things defined are bare words, and come with
> some caveats, and I don't think you want to use it here.
Fixed.
> The substance of the test looks good.
Thanks for looking!
One new-to-me fact from the -general mailing list this morning[1] is
that the EDB installer is explicitly feeding these unstable locale
names into the world's database clusters, so that's something that's
beyond the power of us upstream PostgreSQL hackers to fix even if we
pulled the trigger on the initdb BCP47-by-default patch[2]. Something
for someone at EDB to look into?
[1] https://www.postgresql.org/message-id/flat/CA%2BhUKGJA4pGEeZtfUUEuQmNNO7x16wZ%2BRWOeXP%2Btq3Hf4iu8oQ...
[2] https://www.postgresql.org/message-id/flat/CA+hUKGJ=XThErgAQRoqfCy1bKPxXVuF0=2zDbB+SxDs59pv7Fw@mail....
Attachments: download all (2 files, .tar.gz)
v4-0001-Make-win32locale.c-s-kludge-table-dynamic.patch (text/x-patch, 26.3K) download
From 84803d725a9e1913a59c37909bd9d5c573870d38 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Tue, 14 May 2024 16:46:27 +1200
Subject: [PATCH v4 1/2] Make win32locale.c's kludge table dynamic.
Historically, we transformed Windows' locale names on entry to and exit
from setlocale() using a hard-coded lookup table, because they are
unstable and we can't really handle non-ASCII locale names. We
shouldn't be using these unstable display names, but *setlocale()
itself* gave them to us, and it can't even understand everything it
returns, leading to a series of historical kludges.
Ideally we should soon switch to BCP47 codes for new clusters, but we'll
have to support the older names in ancient database clusters for now and
deal with the transition.
So, provide users with an emergency option for getting unstuck, since
they probably don't want to wait 3-6 months for a new binary with an
updated kludge table when their database fails to come up. While there
are probably workarounds within Windows tools, it seems easy enough to
offer a textfile of name mappings. It might also have applications in
the transition to BCP47.
To help Unix-based developers who couldn't otherwise test this code,
provide a developer-only way to replace setlocale() on Unix too, if the
macro DEBUG_SETLOCALE_MAP is defined, and run the test if PG_EXTRA_TESTS
contains DEBUG_SETLOCALE_MAP.
Reviewed-by: Andrew Dunstan <andrew@dunslane.net> (tests)
Discussion: https://postgr.es/m/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.namprd21.prod.outlook.com
---
doc/src/sgml/charset.sgml | 58 ++-
src/include/pg_config_manual.h | 6 +
src/include/port.h | 11 +
src/port/chklocale.c | 7 +
src/port/win32setlocale.c | 402 ++++++++++++++----
src/test/modules/test_misc/meson.build | 1 +
.../modules/test_misc/t/007_setlocale_map.pl | 149 +++++++
src/tools/pgindent/typedefs.list | 1 +
8 files changed, 552 insertions(+), 83 deletions(-)
create mode 100644 src/test/modules/test_misc/t/007_setlocale_map.pl
diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml
index 834cb30c85a..5c0e2751084 100644
--- a/doc/src/sgml/charset.sgml
+++ b/doc/src/sgml/charset.sgml
@@ -630,8 +630,64 @@ SELECT 'N-45' < 'N-123' COLLATE mycollation5 as result;
mailing list.
</para>
</sect2>
- </sect1>
+ <sect2 id="locale-windows">
+ <title>Windows locale names</title>
+ <para>
+ Before adopting BCP 47 language tags, Windows used names spelled out in
+ full English words. The traditional names are still supported by Windows
+ and PostgreSQL, but are not recommended. They can change unexpectedly in
+ operating system updates, which can cause PostgreSQL to fail to start. It
+ may have references to the old name in
+ <literal>postgresql.conf</literal> and the <link
+ linkend="catalog-pg-database"><structname>pg_database</structname></link>
+ catalog. The old names also sometimes contain non-ASCII characters, which
+ are not allowed in shared catalog tables.
+ </para>
+ <para>
+ To be able to log into a cluster after the operating system has stopped
+ recognizing a locale name, a mapping file can be installed to redirect the
+ locale to a new name on the fly. Its full path can either be provided in
+ the environment variable <literal>PG_SETLOCALE_MAP</literal>, or in a file
+ named <filename>share/setlocale.map</filename> in the installation
+ directory.
+ </para>
+ <para>
+ Each non-comment line of the file has a pattern and a replacement string
+ separated by an equal sign. The pattern can contain
+ <literal>?</literal> wildcard characters, and optionally a <literal>*</literal>
+ wildcard to match any sequence. The replacement name can be any sort of locale
+ name, including a stable BCP 47 locale name. For example:
+<screen>
+# "Turkish_Turkey.1254" changed to "Turkish_Türkiye.1254" in a Windows update.
+# If either of these names is the database default, convert them to the
+# stable BCP 47 equivalent on the fly. Use a wildcard to detect both
+# names and avoid encoding problems in the name itself.
+Turkish_T*.1254=tr-TR
+</screen>
+ </para>
+ <para>
+ Locale mapping files provide a migration pathway when a locale's name has
+ changed. The replacement name should be a name for the "same" locale, or
+ indexes might become corrupted. Once an affected cluster has been made
+ operational with the help of a mapping file, references to the locale
+ should ideally be updated to the new name. This must be done in the
+ <link linkend="catalog-pg-database"><structname>pg_database</structname></link>
+ catalog by direct <command>UPDATE</command>, to avoid problems creating
+ new databases from template databases due to mismatching locale names.
+ </para>
+ <para>
+ Unless a file is installed by the user, PostgreSQL behaves as though the
+ following file were installed, for historical reasons:
+<screen>
+Hong Kong S.A.R.=HKG
+U.A.E.=ARE
+Chinese (Traditional)_Maca? S.A.R..950=ZHM
+Chinese_Maca? S.A.R..950=ZHM
+</screen>
+ </para>
+ </sect2>
+ </sect1>
<sect1 id="collation">
<title>Collation Support</title>
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index f941ee2faf8..e04b02908a2 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -141,6 +141,12 @@
#define EXEC_BACKEND
#endif
+/*
+ * Define DEBUG_SETLOCALE_MAP to test the setlocale() replacement function on
+ * Unix sytems. Normally it is used only on Windows.
+ */
+/* #define DEBUG_SETLOCALE_MAP */
+
/*
* USE_POSIX_FADVISE controls whether Postgres will attempt to use the
* posix_fadvise() kernel call. Usually the automatic configure tests are
diff --git a/src/include/port.h b/src/include/port.h
index ae115d2d970..0f482391c69 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -501,6 +501,17 @@ extern bool wait_result_is_signal(int exit_status, int signum);
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
extern int wait_result_to_exit_code(int exit_status);
+/*
+ * Debug-only option to allow Unix systems to test the setlocale() replacement
+ * code we use on Windows.
+ */
+#ifdef DEBUG_SETLOCALE_MAP
+/* port/win32setlocale.c */
+#undef setlocale
+extern char *pgwin32_setlocale(int category, const char *locale);
+#define setlocale(a,b) pgwin32_setlocale(a,b)
+#endif
+
/*
* Interfaces that we assume all Unix system have. We retain individual macros
* for better documentation.
diff --git a/src/port/chklocale.c b/src/port/chklocale.c
index 8cb81c8640e..7e8bcfbf2d8 100644
--- a/src/port/chklocale.c
+++ b/src/port/chklocale.c
@@ -431,3 +431,10 @@ pg_get_encoding_from_locale(const char *ctype, bool write_message)
}
#endif /* (HAVE_LANGINFO_H && CODESET) || WIN32 */
+
+/*
+ * An option allowing Unix developers to test the pgwin32_setlocale() function.
+ */
+#if !defined(WIN32) && defined(DEBUG_SETLOCALE_MAP)
+#include "win32setlocale.c"
+#endif
diff --git a/src/port/win32setlocale.c b/src/port/win32setlocale.c
index 9e2ab8cc3ad..490b1ae0d57 100644
--- a/src/port/win32setlocale.c
+++ b/src/port/win32setlocale.c
@@ -36,25 +36,38 @@
#undef setlocale
-struct locale_map
-{
- /*
- * String in locale name to replace. Can be a single string (end is NULL),
- * or separate start and end strings. If two strings are given, the locale
- * name must contain both of them, and everything between them is
- * replaced. This is used for a poor-man's regexp search, allowing
- * replacement of "start.*end".
- */
- const char *locale_name_start;
- const char *locale_name_end;
-
- const char *replacement; /* string to replace the match with */
-};
+#ifndef FRONTEND
+#include "pg_config_paths.h"
+#endif
/*
- * Mappings applied before calling setlocale(), to the argument.
+ * The path of a text file that can be created under PGDATA to override these
+ * rules. It allows locale names to be overridden on input to setlocale, and
+ * on return from setlocale when querying the default. This is intended as an
+ * option of last resort for users whose system becomes unstartable due to an
+ * operating system update that changes a locale name.
+ *
+ * # comments begin a hash sign
+ * call pattern=replacement
+ * return pattern=replacemnt
+ *
+ * The pattern syntax supports ? for any character (really byte), and * for
+ * any sequence, though only one star can be used in the whole pattern.
+ *
+ * The encoding of the file is effectively undefined; setlocale() works with
+ * the current Windows ACP, and PostgreSQL thinks the strings should be ASCII
+ * or some undefined superset. This could lead to some confusion if databases
+ * have different encodings, so it's likely that replacements should use BCP47
+ * tags if possible.
*/
-static const struct locale_map locale_map_argument[] = {
+
+typedef struct Win32LocaleTableEntry
+{
+ const char *pattern;
+ const char *replacement;
+} Win32LocaleTableEntry;
+
+static const Win32LocaleTableEntry default_call_mapping_table[] = {
/*
* "HKG" is listed here:
* http://msdn.microsoft.com/en-us/library/cdax410z%28v=vs.71%29.aspx
@@ -63,8 +76,8 @@ static const struct locale_map locale_map_argument[] = {
* "ARE" is the ISO-3166 three-letter code for U.A.E. It is not on the
* above list, but seems to work anyway.
*/
- {"Hong Kong S.A.R.", NULL, "HKG"},
- {"U.A.E.", NULL, "ARE"},
+ {"Hong Kong S.A.R.", "HKG"},
+ {"U.A.E.", "ARE"},
/*
* The ISO-3166 country code for Macau S.A.R. is MAC, but Windows doesn't
@@ -79,17 +92,13 @@ static const struct locale_map locale_map_argument[] = {
*
* Some versions of Windows spell it "Macau", others "Macao".
*/
- {"Chinese (Traditional)_Macau S.A.R..950", NULL, "ZHM"},
- {"Chinese_Macau S.A.R..950", NULL, "ZHM"},
- {"Chinese (Traditional)_Macao S.A.R..950", NULL, "ZHM"},
- {"Chinese_Macao S.A.R..950", NULL, "ZHM"},
- {NULL, NULL, NULL}
+ {"Chinese (Traditional)_Maca? S.A.R..950", "ZHM"},
+ {"Chinese_Maca? S.A.R..950", "ZHM"},
+
+ {NULL}
};
-/*
- * Mappings applied after calling setlocale(), to its return value.
- */
-static const struct locale_map locale_map_result[] = {
+static const Win32LocaleTableEntry return_mapping_table[] = {
/*
* "Norwegian (Bokmål)" locale name contains the a-ring character.
* Map it to a pure-ASCII alias.
@@ -100,84 +109,309 @@ static const struct locale_map locale_map_result[] = {
* Just to make life even more complicated, some versions of Windows spell
* the locale name without parentheses. Translate that too.
*/
- {"Norwegian (Bokm", "l)_Norway", "Norwegian_Norway"},
- {"Norwegian Bokm", "l_Norway", "Norwegian_Norway"},
- {NULL, NULL, NULL}
+ {"Norwegian (Bokm*l)_Norway", "Norwegian_Norway"},
+ {"Norwegian Bokm*l_Norway", "Norwegian_Norway"},
+
+ {NULL}
};
-#define MAX_LOCALE_NAME_LEN 100
+static const Win32LocaleTableEntry *call_mapping_table;
-static const char *
-map_locale(const struct locale_map *map, const char *locale)
+/*
+ * Parse a line of the mapping file. Returns 0 on success. Squawks to stderr
+ * on failure, but also sets the errno for setlocale() to fail with and
+ * returns -1 in that case.
+ */
+static int
+parse_line(const char *path,
+ char *line,
+ int line_number,
+ char **pattern,
+ char **replacement)
+{
+ const char *delimiter;
+ size_t len;
+
+ /* Strip line endings. */
+ while ((len = strlen(line)) > 0 &&
+ (line[len - 1] == '\r' || line[len - 1] == '\n'))
+ line[len - 1] = '\0';
+
+ /* Skip empty lines and shell-style comments. */
+ if (line[0] == '\0' || line[0] == '#')
+ return 0;
+
+ /* Look for the equal sign followed by something. */
+ delimiter = strchr(line, '=');
+ if (!delimiter || delimiter[1] == '\0')
+ {
+ fprintf(stderr,
+ "syntax error on line %d of \"%s\", expected pattern=replacement'\n",
+ line_number, path);
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Copy the pattern. */
+ len = delimiter - line;
+ *pattern = malloc(len + 1);
+ if (!*pattern)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(*pattern, line, len);
+ (*pattern)[len] = '\0';
+
+ /* Copy the replacement. */
+ *replacement = strdup(delimiter + 1);
+ if (!*replacement)
+ {
+ free(*pattern);
+ errno = ENOMEM;
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * Free a mapping table. Only used for cleanup on failure, because otherwise
+ * the mapping table is built once and sticks around until process exit.
+ */
+static void
+free_call_mapping_table(Win32LocaleTableEntry *table)
+{
+ while (table->pattern)
+ {
+ free(unconstify(char *, table->pattern));
+ free(unconstify(char *, table->replacement));
+ table++;
+ }
+ free(table);
+}
+
+/*
+ * Initialize call_mapping_table and call_mapping_table_size. On failure,
+ * errno is set and an error message is written to stderr.
+ */
+static int
+initialize_call_mapping_table(void)
{
- static char aliasbuf[MAX_LOCALE_NAME_LEN];
- int i;
+ FILE *file;
+ const char *path;
+ char line[128];
+ int line_number;
+ Win32LocaleTableEntry *table;
+ size_t table_size;
+ size_t table_capacity;
+
+ /* Has the user specified a map file in the environment? */
+ path = getenv("PG_SETLOCALE_MAP");
- /* Check if the locale name matches any of the problematic ones. */
- for (i = 0; map[i].locale_name_start != NULL; i++)
+ /*
+ * In backends only, fall back to trying to find a file installed in the
+ * share directory.
+ */
+ if (!path)
{
- const char *needle_start = map[i].locale_name_start;
- const char *needle_end = map[i].locale_name_end;
- const char *replacement = map[i].replacement;
- char *match;
- char *match_start = NULL;
- char *match_end = NULL;
-
- match = strstr(locale, needle_start);
- if (match)
+#ifndef FRONTEND
+ path = PGSHAREDIR "/setlocale.map";
+#else
+ /* Use defaults in frontend. */
+ call_mapping_table = default_call_mapping_table;
+ return 0;
+#endif
+ }
+
+ /* If there is no mapping file at that path, use defaults. */
+ file = fopen(path, "r");
+ if (!file)
+ {
+ call_mapping_table = default_call_mapping_table;
+ return 0;
+ }
+
+ /* Initial guess at required space. */
+ table_size = 0;
+ table_capacity = 16;
+ table = malloc(sizeof(Win32LocaleTableEntry) * table_capacity);
+ if (table == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ table->pattern = NULL;
+
+ /* Read the file line-by-line. */
+ line_number = 0;
+ while (fgets(line, sizeof(line), file))
+ {
+ char *pattern = NULL;
+ char *replacement;
+
+ if (parse_line(path,
+ line,
+ line_number++,
+ &pattern,
+ &replacement) != 0)
{
- /*
- * Found a match for the first part. If this was a two-part
- * replacement, find the second part.
- */
- match_start = match;
- if (needle_end)
- {
- match = strstr(match_start + strlen(needle_start), needle_end);
- if (match)
- match_end = match + strlen(needle_end);
- else
- match_start = NULL;
- }
- else
- match_end = match_start + strlen(needle_start);
+ int save_errno = errno;
+
+ free_call_mapping_table(table);
+ fclose(file);
+ errno = save_errno;
+ return -1;
}
- if (match_start)
+ /* Skip blank/comments. */
+ if (pattern == NULL)
+ continue;
+
+ /*
+ * Grow by doubling on demand. Allow an extra entry because we want a
+ * null terminator.
+ */
+ if (table_size + 1 == table_capacity)
{
- /* Found a match. Replace the matched string. */
- int matchpos = match_start - locale;
- int replacementlen = strlen(replacement);
- char *rest = match_end;
- int restlen = strlen(rest);
-
- /* check that the result fits in the static buffer */
- if (matchpos + replacementlen + restlen + 1 > MAX_LOCALE_NAME_LEN)
- return NULL;
-
- memcpy(&aliasbuf[0], &locale[0], matchpos);
- memcpy(&aliasbuf[matchpos], replacement, replacementlen);
- /* includes null terminator */
- memcpy(&aliasbuf[matchpos + replacementlen], rest, restlen + 1);
-
- return aliasbuf;
+ Win32LocaleTableEntry *new_table;
+
+ new_table = malloc(sizeof(*new_table) * table_capacity * 2);
+ if (new_table == NULL)
+ {
+ free_call_mapping_table(table);
+ fclose(file);
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(new_table, table, sizeof(*table) * table_size);
+ free(table);
+ table = new_table;
+ table_capacity *= 2;
}
+
+ /* Fill in new entry. */
+ table[table_size].pattern = pattern;
+ table[table_size].replacement = replacement;
+ table_size++;
+
+ table[table_size].pattern = NULL;
}
- /* no match, just return the original string */
- return locale;
+ fclose(file);
+
+ /* Mapping table established for this process. */
+ call_mapping_table = table;
+
+ return 0;
}
+/*
+ * Checks if n bytes of pattern and name match. '?' is treated as a wildcard
+ * in the pattern, but all other bytes must be identical to match.
+ */
+static bool
+subpattern_matches(const char *pattern, const char *name, size_t n)
+{
+ while (n > 0)
+ {
+ /* Have we hit the end of the pattern or name? */
+ if (*pattern == '\0')
+ return *name == '\0';
+ else if (*name == '\0')
+ return false;
+
+ /* Otherwise matches wildcard or exact character. */
+ if (*pattern != '?' && *pattern != *name)
+ return false;
+
+ /* Next. */
+ n--;
+ pattern++;
+ name++;
+ }
+ return true;
+}
+
+/*
+ * Checks if a name matches a pattern, with an extremely simple pattern logic.
+ * The pattern may contain any number of '?' characters to match any character,
+ * and zero or one '*' characters to match any sequence of characters.
+ */
+static bool
+pattern_matches(const char *pattern, const char *name)
+{
+ const char *star;
+
+ if ((star = strchr(pattern, '*')))
+ {
+ size_t len_pattern_before_star;
+ size_t len_pattern_after_star;
+ size_t len_name;
+
+ /* Does the name match the part before the star? */
+ len_pattern_before_star = star - pattern;
+ if (!subpattern_matches(pattern, name, len_pattern_before_star))
+ return false;
+
+ /* Step over the star in the pattern. */
+ pattern += len_pattern_before_star;
+ pattern++;
+ len_pattern_after_star = strlen(pattern);
+
+ /* Step over the star in the name. */
+ name += len_pattern_before_star;
+ len_name = strlen(name);
+ if (len_name < len_pattern_after_star)
+ return false;
+ name += len_name - len_pattern_after_star;
+ }
+
+ return subpattern_matches(pattern, name, SIZE_MAX);
+}
+
+/*
+ * Convert a locale name using the given table, if it contains a matching
+ * pattern.
+ */
+static const char *
+map_locale(const Win32LocaleTableEntry *table, const char *name)
+{
+ while (table->pattern)
+ {
+ if (pattern_matches(table->pattern, name))
+ return table->replacement;
+ table++;
+ }
+ return name;
+}
+
+/*
+ * This implementation sets errno and in some cases writes messages to stderr
+ * for catastrophic internal failures, though the POSIX function defines no
+ * errors so callers don't actually check errno.
+ */
char *
pgwin32_setlocale(int category, const char *locale)
{
const char *argument;
char *result;
+ if (!call_mapping_table)
+ {
+ if (initialize_call_mapping_table() < 0)
+ return NULL;
+ }
+
+ /*
+ * XXX Call value transformation is relevant as long as we think there are
+ * existing systems that were initdb'd with unstable and non-ASCII locale
+ * names.
+ */
if (locale == NULL)
argument = NULL;
else
- argument = map_locale(locale_map_argument, locale);
+ argument = map_locale(call_mapping_table, locale);
/* Call the real setlocale() function */
result = setlocale(category, argument);
@@ -185,9 +419,13 @@ pgwin32_setlocale(int category, const char *locale)
/*
* setlocale() is specified to return a "char *" that the caller is
* forbidden to modify, so casting away the "const" is innocuous.
+ *
+ * XXX Return value transformation is only relevant as long as we continue
+ * to use setlocale("") as a way to query the default locale names, which
+ * is the source of the unstable and non-ASCII locale names.
*/
if (result)
- result = unconstify(char *, map_locale(locale_map_result, result));
+ result = unconstify(char *, map_locale(return_mapping_table, result));
return result;
}
diff --git a/src/test/modules/test_misc/meson.build b/src/test/modules/test_misc/meson.build
index 283ffa751aa..a7d3c2b665c 100644
--- a/src/test/modules/test_misc/meson.build
+++ b/src/test/modules/test_misc/meson.build
@@ -15,6 +15,7 @@ tests += {
't/004_io_direct.pl',
't/005_timeouts.pl',
't/006_signal_autovacuum.pl',
+ 't/007_setlocale_map.pl',
],
},
}
diff --git a/src/test/modules/test_misc/t/007_setlocale_map.pl b/src/test/modules/test_misc/t/007_setlocale_map.pl
new file mode 100644
index 00000000000..d9da346490c
--- /dev/null
+++ b/src/test/modules/test_misc/t/007_setlocale_map.pl
@@ -0,0 +1,149 @@
+
+# Copyright (c) 2024, PostgreSQL Global Development Group
+
+# Test of the PG_SETLOCALE_MAP mechanism for renaming locales on the fly. This
+# always runs on Windows. It is usually skipped on Unix.
+
+# For the benefit of Unix-based developers, it also runs if PG_TEST_EXTRA
+# contains DEBUG_SETLOCALE_MAP, and is expected to pass only if PostgreSQL was
+# compiled with the macro DEBUG_SETLOCALE_MAP defined (see pg_config_manual.h).
+# In that case, locales "en_US.UTF-8" and "fr_FR.UTF-8" are assumed to exist,
+# which may require extra system packages on some systems.
+
+# The assumption this test makes about locales is that "C" sorts lower case
+# before upper case (this is true by definition), while natural language
+# locales do not (true in practice).
+
+use strict;
+use warnings FATAL => 'all';
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
+use Test::More;
+
+if (!$windows_os && $ENV{PG_TEST_EXTRA} !~ /\bDEBUG_SETLOCALE_MAP\b/)
+{
+ plan skip_all =>
+ 'setlocale mapping on non-Windows requires DEBUG_SETLOCALE_MAP';
+}
+
+my ($encoding, $locale1, $locale2, $locale1_pattern);
+
+if ($windows_os)
+{
+ # the purpose of this facility is to deal with changes in the spelling of
+ # the locale name, by allowing people a way to transition to BCP 47 names,
+ # so we'll use that in our example
+ $encoding = 'WIN1252';
+ $locale1 = 'English_United States.1252';
+ $locale2 = 'en-US';
+ $locale1_pattern = 'English_*.1252';
+}
+else
+{
+ # when testing on Unix, we don't expect there to be another way to spell
+ # the same locale so we'll just pick another language (normally you would
+ # never want to do this)
+ $encoding = 'UTF8';
+ $locale1 = 'en_US.UTF-8';
+ $locale2 = 'fr_FR.UTF-8';
+ $locale1_pattern = 'en_*.UTF-8';
+}
+
+my $pg_setlocale_map =
+ $PostgreSQL::Test::Utils::tmp_check . "/my_setlocale.map";
+$ENV{PG_SETLOCALE_MAP} = $pg_setlocale_map;
+$ENV{PG_TEST_INITDB_EXTRA_OPTS} = "--locale='$locale1' --encoding=$encoding";
+
+sub install_setlocale_map
+{
+ my $contents = shift;
+ open my $f, ">", $pg_setlocale_map or die $!;
+ print $f $contents;
+ close $f;
+}
+
+my $node = PostgreSQL::Test::Cluster->new('main');
+$node->init(force_initdb => 1);
+$node->append_conf('postgresql.conf', 'lc_messages=C');
+$node->append_conf('postgresql.conf', 'lc_monetary=C');
+$node->append_conf('postgresql.conf', 'lc_numeric=C');
+$node->append_conf('postgresql.conf', 'lc_time=C');
+
+$node->start;
+is($node->safe_psql('postgres', "select 'Z' > 'a'"),
+ 't', "natural language order");
+$node->stop;
+
+# install some non-matching mapping rules, see that nothing changes
+install_setlocale_map <<"EOF";
+foo*=C
+EOF
+
+$node->start;
+is($node->safe_psql('postgres', "select 'Z' > 'a'"),
+ 't', "still natural language order");
+$node->stop;
+
+# install some matching mapping rules that will give us "C"; use the pattern
+# format just to exercise the pattern matching code
+install_setlocale_map <<"EOF";
+$locale1_pattern=C
+EOF
+
+$node->start;
+is($node->safe_psql('postgres', "select 'a' > 'Z'"), 't', "encoding order");
+$node->stop;
+
+# install a mapping to a second natural language, and check that we can
+# create a database from template0
+install_setlocale_map <<"EOF";
+$locale1=$locale2
+EOF
+
+$node->start;
+is($node->safe_psql('postgres', "select 'Z' > 'a'"),
+ 't', "natural language order via second locale name");
+$node->safe_psql('postgres',
+ "create database regression_db2 template=template0");
+
+# unfortunately we can't create a database from the default template1
+# because now the locale names don't match!
+is($node->safe_psql('postgres', "select 'Z' > 'a'"),
+ 't', "natural language order via second locale name");
+my ($result, $stdout, $stderr) =
+ $node->psql('postgres', "create database regression_db3");
+ok( $stderr =~
+ /ERROR: new collation \($locale2\) is incompatible with the collation of the template database \($locale1\)/,
+ "cannot create new database because of locale mismatch with template1");
+
+# it's the same even if we explicitly give the locale name, old or new
+($result, $stdout, $stderr) =
+ $node->psql('postgres', "create database regression_db3 locale='$locale1'");
+ok( $stderr =~
+ /ERROR: new collation \($locale2\) is incompatible with the collation of the template database \($locale1\)/,
+ "cannot create new database because of locale mismatch with template1, explicit old"
+);
+($result, $stdout, $stderr) =
+ $node->psql('postgres', "create database regression_db3 locale='$locale2'");
+ok( $stderr =~
+ /ERROR: new collation \($locale2\) is incompatible with the collation of the template database \($locale1\)/,
+ "cannot create new database because of locale mismatch with template1, explicit new"
+);
+
+# to fix that problem we have to do the renaming in the catalog (note that the
+# mapping file still did something very useful by letting us log in to do this,
+# in the case where $LOCALE1 is no longer recognized by the OS)
+$node->safe_psql('postgres',
+ "update pg_database set datcollate = '$locale2' where datlocprovider = 'c' and datcollate = '$locale1'"
+);
+$node->safe_psql('postgres',
+ "update pg_database set datctype = '$locale2' where datlocprovider = 'c' and datctype = '$locale1'"
+);
+
+# now it should work, and we don't really need the mapping file anymore except
+# to deal with uses of the old name in postgresql.conf
+$node->safe_psql('postgres', "create database regression_db3");
+
+$node->stop;
+
+done_testing();
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index b4d7f9217ce..7cb69c4945a 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -3135,6 +3135,7 @@ WalUsage
WalWriteMethod
WalWriteMethodOps
Walfile
+Win32LocaleTableEntry
WindowAgg
WindowAggPath
WindowAggState
--
2.45.2
v4-0002-ci-Enable-DEBUG_SETLOCALE_MAP-on-FreeBSD-task.patch (text/x-patch, 1.5K) download
From 85c3c097beb1a41f910f590d1415f751fe254b46 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Sun, 21 Jul 2024 15:44:10 +1200
Subject: [PATCH v4 2/2] ci: Enable DEBUG_SETLOCALE_MAP on FreeBSD task.
The 007_setlocale_map.pl test runs automatically on Windows, but it can
also be exercised on Unixoid systems with a special build option. Do
that on the FreeBSD task, so we can make sure it works. On other
Unixen, it will be skipped.
---
.cirrus.tasks.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 99ca74d5133..8bd057eaf86 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -133,7 +133,7 @@ task:
DISK_SIZE: 50
CCACHE_DIR: /tmp/ccache_dir
- CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DCOPY_PARSE_PLAN_TREES -DWRITE_READ_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
+ CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DCOPY_PARSE_PLAN_TREES -DWRITE_READ_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS -DDEBUG_SETLOCALE_MAP
CFLAGS: -Og -ggdb
PG_TEST_PG_UPGRADE_MODE: --link
@@ -174,7 +174,7 @@ task:
--buildtype=debug \
-Dcassert=true -Dinjection_points=true \
-Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
- -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
+ -DPG_TEST_EXTRA="$PG_TEST_EXTRA DEBUG_SETLOCALE_MAP" \
-Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
build
EOF
--
2.45.2
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-07-22 11:24 ` Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
0 siblings, 1 reply; 73+ messages in thread
From: Andrew Dunstan @ 2024-07-22 11:24 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On 2024-07-21 Su 6:00 PM, Thomas Munro wrote:
> One new-to-me fact from the -general mailing list this morning[1] is
> that the EDB installer is explicitly feeding these unstable locale
> names into the world's database clusters, so that's something that's
> beyond the power of us upstream PostgreSQL hackers to fix even if we
> pulled the trigger on the initdb BCP47-by-default patch[2]. Something
> for someone at EDB to look into?
>
> [1]https://www.postgresql.org/message-id/flat/CA%2BhUKGJA4pGEeZtfUUEuQmNNO7x16wZ%2BRWOeXP%2Btq3Hf4iu8oQ...
> [2]https://www.postgresql.org/message-id/flat/CA+hUKGJ=XThErgAQRoqfCy1bKPxXVuF0=2zDbB+SxDs59pv7Fw@mail....
Sandeep, can you comment?
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
@ 2024-07-22 12:12 ` Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Sandeep Thakkar @ 2024-07-22 12:12 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Thomas Munro <thomas.munro@gmail.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Hi
On Mon, Jul 22, 2024 at 4:54 PM Andrew Dunstan <andrew@dunslane.net> wrote:
>
> On 2024-07-21 Su 6:00 PM, Thomas Munro wrote:
>
> One new-to-me fact from the -general mailing list this morning[1] is
> that the EDB installer is explicitly feeding these unstable locale
> names into the world's database clusters, so that's something that's
> beyond the power of us upstream PostgreSQL hackers to fix even if we
> pulled the trigger on the initdb BCP47-by-default patch[2]. Something
> for someone at EDB to look into?
>
> [1] https://www.postgresql.org/message-id/flat/CA%2BhUKGJA4pGEeZtfUUEuQmNNO7x16wZ%2BRWOeXP%2Btq3Hf4iu8oQ...
> [2] https://www.postgresql.org/message-id/flat/CA+hUKGJ=XThErgAQRoqfCy1bKPxXVuF0=2zDbB+SxDs59pv7Fw@mail....
>
>
> Sandeep, can you comment?
>
>
> I responded to it at
https://www.postgresql.org/message-id/CANFyU95Le%2BtrZbtB1D4Y1FdUu4y_OJLxvJMi1Zb9WOWuf8KpqA%40mail.g...
When I checked the installation log shared by Ertan at
https://github.com/EnterpriseDB/edb-installers/issues/127, I see installer
is using the correct locale name while doing initdb.
Executing C:\Windows\System32\cscript //NoLogo "C:\Program
Files\PostgreSQL\16/installer/server/initcluster.vbs" "NT
AUTHORITY\NetworkService" "postgres" "****"
"C:\Users\User1\AppData\Local\Temp/postgresql_installer_cd79fad8b7"
"C:\Program Files\PostgreSQL\16" "C:\DATA_PG16" 5432 "Turkish,Türkiye" 0
Thomas, I can generate the test installer with your patch and share here so
this issue can be tested before the minor release?
cheers
>
>
> andrew
>
> --
> Andrew Dunstan
> EDB: https://www.enterprisedb.com
>
>
--
Sandeep Thakkar
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
@ 2024-07-25 06:08 ` Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-07-25 06:08 UTC (permalink / raw)
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Tue, Jul 23, 2024 at 12:12 AM Sandeep Thakkar
<sandeep.thakkar@enterprisedb.com> wrote:
> Thomas, I can generate the test installer with your patch and share here so this issue can be tested before the minor release?
That might be useful, thanks! If someone wants to try it out on a
real Windows system.
. o O { I wonder if it could ever be possible to have that automated
via CI. Imagine if I/anyone could clone the EDB installer github
repo, and push a small patch into a private branch that tells it where
to pull PostgreSQL sources from, including any public git branch
including commitfest ones, and some options like with/without
assertions, and have CI spit out a new installer as an artifact?
Hopefully non-REL_XXX_STABLE branches would have a big warning on the
GUI so that users would never accidentally think it's a real release.
}
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-07-31 09:53 ` Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-08 23:45 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 2 replies; 73+ messages in thread
From: Sandeep Thakkar @ 2024-07-31 09:53 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Thu, Jul 25, 2024 at 11:39 AM Thomas Munro <thomas.munro@gmail.com>
wrote:
> On Tue, Jul 23, 2024 at 12:12 AM Sandeep Thakkar
> <sandeep.thakkar@enterprisedb.com> wrote:
> > Thomas, I can generate the test installer with your patch and share here
> so this issue can be tested before the minor release?
>
> That might be useful, thanks! If someone wants to try it out on a
> real Windows system.
>
Sure, I can give it a try. Is your patch ready?
>
> . o O { I wonder if it could ever be possible to have that automated
> via CI. Imagine if I/anyone could clone the EDB installer github
> repo, and push a small patch into a private branch that tells it where
> to pull PostgreSQL sources from, including any public git branch
> including commitfest ones, and some options like with/without
> assertions, and have CI spit out a new installer as an artifact?
> Hopefully non-REL_XXX_STABLE branches would have a big warning on the
> GUI so that users would never accidentally think it's a real release.
> }
>
yeah, that'll be helpful but unfortunately it's not possible atm.
Hopefully, we will
have that available in future through the GitHub actions.
--
Sandeep Thakkar
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
@ 2024-08-08 02:35 ` Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
1 sibling, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-08-08 02:35 UTC (permalink / raw)
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
I am going to withdraw this proposal. In another email thread, we
learned two very important things:
1. The problem of a locale names changing for an *existing* database
can apparently be fixed using "Locale Builder"[1]. Users in Turkey
have presumably already addressed the situation that way and there are
reports of articles about that in Turkish. We don't really need the
"setlocale.map" rename-on-the-fly patch in this thread, and I don't
want to maintain it if we don't need it.
2. The Windows runtime library is crashing when initdb's subprocess
postgres.exe calls it with a name encoded in an encoding it doesn't
like[2]. (IMHO it should return NULL instead! The C standard does
not have a demons-may-fly-out-of-your-nose clause.) We need to tell
users not to use those locale names. That string is actually coming
from the EDB installer, and we'll follow up on that. Perhaps
PostgreSQL should also consider stripping non-ASCII characters to
force it to fail nicely.
[1] https://www.postgresql.org/message-id/CA%2BhUKGLyfou2xa2fxGOs0WwkOrcKjwqn-bRNR01Hq5RAD16ueg%40mail.g...
[2] https://www.postgresql.org/message-id/CA%2BhUKG%2BFxeRLURZ%3Dn8NPyLwgjFds_SqU_cQvE40ks6RQKUGbGg%40ma...
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-08-26 21:29 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-08-26 21:29 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Hi Thomas and Andrew,
Just would like to follow up with you about this bug. How is it going with the investigation?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Wednesday, August 7, 2024 7:35 PM
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
Cc: Andrew Dunstan <andrew@dunslane.net>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
I am going to withdraw this proposal. In another email thread, we learned two very important things:
1. The problem of a locale names changing for an *existing* database can apparently be fixed using "Locale Builder"[1]. Users in Turkey have presumably already addressed the situation that way and there are reports of articles about that in Turkish. We don't really need the "setlocale.map" rename-on-the-fly patch in this thread, and I don't want to maintain it if we don't need it.
2. The Windows runtime library is crashing when initdb's subprocess postgres.exe calls it with a name encoded in an encoding it doesn't like[2]. (IMHO it should return NULL instead! The C standard does not have a demons-may-fly-out-of-your-nose clause.) We need to tell users not to use those locale names. That string is actually coming from the EDB installer, and we'll follow up on that. Perhaps PostgreSQL should also consider stripping non-ASCII characters to force it to fail nicely.
[1] https://www.postgresql.org/message-id/CA%2BhUKGLyfou2xa2fxGOs0WwkOrcKjwqn-bRNR01Hq5RAD16ueg%40mail.g...
[2] https://www.postgresql.org/message-id/CA%2BhUKG%2BFxeRLURZ%3Dn8NPyLwgjFds_SqU_cQvE40ks6RQKUGbGg%40ma...
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-08-28 10:16 ` Thomas Munro <thomas.munro@gmail.com>
2024-08-28 19:34 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Shawn Steele <Shawn.Steele@microsoft.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
0 siblings, 2 replies; 73+ messages in thread
From: Thomas Munro @ 2024-08-28 10:16 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Tue, Aug 27, 2024 at 9:29 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Just would like to follow up with you about this bug. How is it going with the investigation?
Well, we figured out that Windows is aborting inside setlocale(). The
C standard says "The pointer to string returned by the setlocale
function is such that a subsequent call with that string value and its
associated category will restore that part of the program’s locale."
Window does not conform, and crashes itself.
One practical change we could make would be to reject non-ASCII locale
names in initdb, as in the attached, and back-patch to 16. Then the
EDB installer (a separate project that is calling initdb and providing
the non-ASCII string containing "ü") would at least get a graceful
failure instead of a crash. It hardly makes a difference to the user,
but I've finally understood that these crashes in the Windows runtime
library might be generating a stream of crash reports to Microsoft,
which might be bringing you here?
For example:
$ initdb -D asdf --locale="liberté"
The files belonging to this database system will be owned by user "tmunro".
This user must also own the server process.
initdb: error: locale name "liberté" contains non-ASCII characters
Attachments:
0001-initdb-Reject-non-ASCII-locale-names.patch (text/x-patch, 1.7K) download
From 158181810d1a4b6798261ca0523a192dbdfeef86 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Wed, 28 Aug 2024 20:52:04 +1200
Subject: [PATCH] initdb: Reject non-ASCII locale names.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit bf03cfd1 started scanning the available BCP 47 locale names on
Windows, but this caused a problem when initdb --locale is given a
name containing non-ASCII characters, such as "Turkish_Türkiye.1254".
The save-restore pattern of setlocale() calls used to check each
locale's encoding also changed the expected encoding of the locale name
itself on the next call, and then Windows' runtime library unhelpfully
aborts.
While master doesn't actually do that setlocale() save-restore anymore
(see 35eeea62), it still seems like a good idea to block non-ASCII
locale names, as their encoding is undefined when stored in PostgreSQL
catalogues.
Back-patch to 16, where bf03cfd1 landed.
Discussion: https://postgr.es/m/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.namprd21.prod.outlook.com
---
src/bin/initdb/initdb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index f00718a015..807d35b96b 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -2138,6 +2138,9 @@ check_locale_name(int category, const char *locale, char **canonname)
if (canonname)
*canonname = NULL; /* in case of failure */
+ if (!pg_is_ascii(locale))
+ pg_fatal("locale name \"%s\" contains non-ASCII characters", locale);
+
save = setlocale(category, NULL);
if (!save)
pg_fatal("setlocale() failed");
--
2.39.2
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-08-28 19:34 ` Shawn Steele <Shawn.Steele@microsoft.com>
1 sibling, 0 replies; 73+ messages in thread
From: Shawn Steele @ 2024-08-28 19:34 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>; Peter Constable <pconstable@microsoft.com>
+Peter Constable, FYI
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Wednesday, August 28, 2024 3:16 AM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Aug 27, 2024 at 9:29 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Just would like to follow up with you about this bug. How is it going with the investigation?
Well, we figured out that Windows is aborting inside setlocale(). The C standard says "The pointer to string returned by the setlocale function is such that a subsequent call with that string value and its associated category will restore that part of the program’s locale."
Window does not conform, and crashes itself.
One practical change we could make would be to reject non-ASCII locale names in initdb, as in the attached, and back-patch to 16. Then the EDB installer (a separate project that is calling initdb and providing the non-ASCII string containing "ü") would at least get a graceful failure instead of a crash. It hardly makes a difference to the user, but I've finally understood that these crashes in the Windows runtime library might be generating a stream of crash reports to Microsoft, which might be bringing you here?
For example:
$ initdb -D asdf --locale="liberté"
The files belonging to this database system will be owned by user "tmunro".
This user must also own the server process.
initdb: error: locale name "liberté" contains non-ASCII characters
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-08-29 15:16 ` Andrew Dunstan <andrew@dunslane.net>
2024-08-29 17:53 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
1 sibling, 2 replies; 73+ messages in thread
From: Andrew Dunstan @ 2024-08-29 15:16 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On 2024-08-28 We 6:16 AM, Thomas Munro wrote:
> On Tue, Aug 27, 2024 at 9:29 AM Haifang Wang (Centific Technologies
> Inc) <v-haiwang@microsoft.com> wrote:
>> Just would like to follow up with you about this bug. How is it going with the investigation?
> Well, we figured out that Windows is aborting inside setlocale(). The
> C standard says "The pointer to string returned by the setlocale
> function is such that a subsequent call with that string value and its
> associated category will restore that part of the program’s locale."
> Window does not conform, and crashes itself.
>
> One practical change we could make would be to reject non-ASCII locale
> names in initdb, as in the attached, and back-patch to 16. Then the
> EDB installer (a separate project that is calling initdb and providing
> the non-ASCII string containing "ü") would at least get a graceful
> failure instead of a crash. It hardly makes a difference to the user,
> but I've finally understood that these crashes in the Windows runtime
> library might be generating a stream of crash reports to Microsoft,
> which might be bringing you here?
>
> For example:
>
> $ initdb -D asdf --locale="liberté"
> The files belonging to this database system will be owned by user "tmunro".
> This user must also own the server process.
>
> initdb: error: locale name "liberté" contains non-ASCII characters
+1 for doing this.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
@ 2024-08-29 17:53 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-29 21:09 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
1 sibling, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-08-29 17:53 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; Thomas Munro <thomas.munro@gmail.com>; Rahul Pandey <pandeyrah@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; +Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Thanks for the reply, Andrew and Thomas. The issue is originally from user feedback. And our team verified and reproduced it too. And it is high priority from our end is because: 1. It is regression, it did not see it in the previous build. 2. After the crash happened, even the app could be installed, but cluster initialization failed. And due to which we cannot connect to the database and proceed further.
@Shawn @Rahul, do you have any comment or suggestions?
Regards!
Haifang
-----Original Message-----
From: Andrew Dunstan <andrew@dunslane.net>
Sent: Thursday, August 29, 2024 8:17 AM
To: Thomas Munro <thomas.munro@gmail.com>; Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
[You don't often get email from andrew@dunslane.net. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
On 2024-08-28 We 6:16 AM, Thomas Munro wrote:
> On Tue, Aug 27, 2024 at 9:29 AM Haifang Wang (Centific Technologies
> Inc) <v-haiwang@microsoft.com> wrote:
>> Just would like to follow up with you about this bug. How is it going with the investigation?
> Well, we figured out that Windows is aborting inside setlocale(). The
> C standard says "The pointer to string returned by the setlocale
> function is such that a subsequent call with that string value and its
> associated category will restore that part of the program’s locale."
> Window does not conform, and crashes itself.
>
> One practical change we could make would be to reject non-ASCII locale
> names in initdb, as in the attached, and back-patch to 16. Then the
> EDB installer (a separate project that is calling initdb and providing
> the non-ASCII string containing "ü") would at least get a graceful
> failure instead of a crash. It hardly makes a difference to the user,
> but I've finally understood that these crashes in the Windows runtime
> library might be generating a stream of crash reports to Microsoft,
> which might be bringing you here?
>
> For example:
>
> $ initdb -D asdf --locale="liberté"
> The files belonging to this database system will be owned by user "tmunro".
> This user must also own the server process.
>
> initdb: error: locale name "liberté" contains non-ASCII characters
+1 for doing this.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com/
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 17:53 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-08-29 21:09 ` Andrew Dunstan <andrew@dunslane.net>
0 siblings, 0 replies; 73+ messages in thread
From: Andrew Dunstan @ 2024-08-29 21:09 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Thomas Munro <thomas.munro@gmail.com>; Rahul Pandey <pandeyrah@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; +Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On 2024-08-29 Th 1:53 PM, Haifang Wang (Centific Technologies Inc) wrote:
> Thanks for the reply, Andrew and Thomas. The issue is originally from user feedback. And our team verified and reproduced it too. And it is high priority from our end is because: 1. It is regression, it did not see it in the previous build. 2. After the crash happened, even the app could be installed, but cluster initialization failed. And due to which we cannot connect to the database and proceed further.
Please don't top-post on PostgreSQL lists.
If I read Thomas correctly, the solution is to create a locale with an
acceptable (pure Ascii) name using Locale Builder, and then call initdb
using that name. It might be that you need to do some of this manually
if the installer fails. IIRC is it possible to run the installer without
having it create a cluster automatically. You can then set up the
cluster and create a windows service manually using initdb / pg_ctl.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
@ 2024-08-29 22:55 ` Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
1 sibling, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-08-29 22:55 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Fri, Aug 30, 2024 at 3:16 AM Andrew Dunstan <andrew@dunslane.net> wrote:
> On 2024-08-28 We 6:16 AM, Thomas Munro wrote:
> > initdb: error: locale name "liberté" contains non-ASCII characters
>
> +1 for doing this.
Thanks for looking! OK, let's go with this approach. That two-line
demo patch doesn't work properly for the system default, and of course
it should be in sync with the backend function, and needs comments to
explain this mess, so I'll work on a serious patch.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-08-30 03:22 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-08-30 03:22 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Fri, Aug 30, 2024 at 10:55 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Fri, Aug 30, 2024 at 3:16 AM Andrew Dunstan <andrew@dunslane.net> wrote:
> > On 2024-08-28 We 6:16 AM, Thomas Munro wrote:
> > > initdb: error: locale name "liberté" contains non-ASCII characters
> >
> > +1 for doing this.
>
> Thanks for looking! OK, let's go with this approach. That two-line
> demo patch doesn't work properly for the system default, and of course
> it should be in sync with the backend function, and needs comments to
> explain this mess, so I'll work on a serious patch.
Done. To develop this patch, I set up a cursed locale name on my
FreeBSD box like so:
$ sudo cp -r /usr/share/locale/fr_FR.UTF-8 /usr/share/locale/fraternité.UTF-8
Then I could exercise the setlocale("") path, approximating what I
expect a Turkish Windows system to do without explicit --locale:
$ LC_TIME="fraternité.UTF-8" initdb -D pdata
...
initdb: error: locale name "fraternité.UTF-8" contains non-ASCII characters
The explicit path is easier to test, like before:
$ initdb -D pgdata --locale "égalité.UTF-9"
...
initdb: error: locale name "égalité.UTF-9" contains non-ASCII characters
That's what the EDB installer (if not changed to provide ASCII-clean
names somehow or other) will start failing with, if it tries to feed
umlauts to initdb.
Working through that, I understood another problem: even if you
provide an acceptable string like --locale "tr-TR", we still need to
be able to save-and-restore the value that initdb inherited from the
environment. Using my simulation, what I mean is if you do:
$ export LANG="liberté.UTF-8"
... then ...
$ initdb -D pgdata --locale "fr_FR.UTF-8"
... it still needs to be able to do a safe save-and-restore back to
the environment's value without crashing, even though it's not really
using that value. I wondered if initdb really needs a locale other
than "C" for itself, but I'm trying to minimise the changes here so I
don't break something else... That seems to mean that we have to use
_wsetlocale() for that particular save/restore. This is essentially
what Haifang's colleagues were suggesting upthread. Done.
Once a server is up and running, we shouldn't be exposed to the server
environment (right?), but there are several more places that accept
user-supplied strings, and only CREATE COLLATION fails to run
check_locale():
postgres=# create collation foo (locale = 'fraternité.UTF-8');
CREATE COLLATION
The other places I am aware of do, so putting the equivalent code into
check_locale() does the right thing:
postgres=# create database db locale = 'fraternité.UTF-8';
WARNING: locale name "fraternité.UTF-8" contains non-ASCII characters
ERROR: invalid LC_COLLATE locale name: "fraternité.UTF-8"
HINT: If the locale name is specific to ICU, use ICU_LOCALE.
postgres=# set lc_time = 'fraternité.UTF-8';
WARNING: locale name "fraternité.UTF-8" contains non-ASCII characters
ERROR: invalid value for parameter "lc_time": "fraternité.UTF-8"
postgres=# set lc_messages = 'fraternité.UTF-8';
WARNING: locale name "fraternité.UTF-8" contains non-ASCII characters
ERROR: invalid value for parameter "lc_messages": "fraternité.UTF-8"
postgres=# set lc_monetary = 'fraternité.UTF-8';
WARNING: locale name "fraternité.UTF-8" contains non-ASCII characters
ERROR: invalid value for parameter "lc_monetary": "fraternité.UTF-8"
Those last SET lc_* changes aren't strictly necessary, because we
never restore to those, we only switch to them and then restore to the
database default, but since they share code with CREATE DATABASE the
new check kicks in anyway.
I tried adding check_locale() checks into CREATE COLLATION, but that
made some tests fail (huh, I didn't know that the set of strings
acceptable to _newlocale() and setlocale() are different -- the former
seems to accept "POSIX" on that OS, which is exercised by some tests,
or maybe it's some path of ours, I didn't check). But, on reflection,
I don't believe that COLLATION objects actually have this problem
anyway, because we never call setlocale() to them, we just use the
modern thread-safe POSIX-2008-oid APIs. So I took that back out to
minimise the patch.
Please see attached, including a restatement of the problem and
solution in the commit message.
I suppose we could add some tests for this, but I was a bit unsure
about the rules for putting non-ASCII into perl scripts and command
lines, and would need to research that...
(Note: a lot of this old stuff is getting ripped out in master by the
ongoing multi-threading effort...)
Attachments:
v2-0001-Reject-non-ASCII-locale-names.patch (text/x-patch, 7.3K) download
From 73f3134eccdb88587cc20e7a7aa39e2f941b3d44 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Wed, 28 Aug 2024 20:52:04 +1200
Subject: [PATCH v2] Reject non-ASCII locale names.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit bf03cfd1 started scanning the available BCP 47 locale names on
Windows. This caused an abort/crash in the Windows runtime library if
initdb used a locale name containing non-ASCII characters, because of
our use of the setlocale() save/restore pattern with C-strings. After
switching to another locale with a different encoding, the saved name
could no longer be understood, and setlocale() would just abort the
process.
"Turkish_Türkiye.1254" is the example from bug reports, a name that
recently changed its spelling, but there are other examples of countries
with non-ASCII characters in their English language name.
To defend against this, the following changes are made:
1. In initdb, reject non-ASCII locale names given explicity on the
command line, and returned by the operating system environment with
setlocale("", ...), and "canonicalized" by the operating system when we
set it.
2. In initdb only, perform the save-and-restore with the wchar_t
variant of setlocale(), so that it is not subject to round trip failure
when the char-based encoding fails.
3. In the backend, we don't have to worry about the save-and-restore
problem because we shouldn't have let any non-ASCII locale names in as
the database default, so we just have to make sure that CREATE DATABASE
also rejects them.
Anyone who encounters the new error message should either create a new
duplicated locale with an ASCII-only name using Windows Locale Builder,
or consider using BCP 47 names like "tr-TR". Users already couldn't
initialize a cluster with "Turkish_Türkiye.1254" on PostgreSQL 16+.
We're just changing the failure more from a crash to an error message.
Users with existing clusters that might eventually be upgraded to 16+
must already have taken one of those approaches to keep their cluster
running, so pg_upgrade to a later version should also still be possible
with this change.
Back-patch to 16, where bf03cfd1 landed. Older versions are affected in
theory, but only 16 and later are generating crash reports.
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/PH8PR21MB3902F334A3174C54058F792CE5182%40PH8PR21MB3902.namprd21.prod.outlook.com
---
src/backend/commands/collationcmds.c | 1 -
src/backend/utils/adt/pg_locale.c | 31 +++++++++++++++++++++++
src/bin/initdb/initdb.c | 38 +++++++++++++++++++++++++++-
3 files changed, 68 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c
index 63ef9a08411..5147e85ba1e 100644
--- a/src/backend/commands/collationcmds.c
+++ b/src/backend/commands/collationcmds.c
@@ -263,7 +263,6 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("parameter \"%s\" must be specified",
"lc_collate")));
-
if (!collctype)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 643cca05d38..497e2d35896 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -58,6 +58,7 @@
#include "catalog/pg_collation.h"
#include "catalog/pg_database.h"
#include "common/hashfn.h"
+#include "common/string.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "utils/builtins.h"
@@ -334,6 +335,16 @@ check_locale(int category, const char *locale, char **canonname)
char *save;
char *res;
+ /* Don't let Windows' non-ASCII locale names in. */
+ if (!pg_is_ascii(locale))
+ {
+ ereport(WARNING,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("locale name \"%s\" contains non-ASCII characters",
+ locale)));
+ return false;
+ }
+
if (canonname)
*canonname = NULL; /* in case of failure */
@@ -341,6 +352,14 @@ check_locale(int category, const char *locale, char **canonname)
if (!save)
return false; /* won't happen, we hope */
+ /*
+ * The global locale should already have been defended against Windows'
+ * non-ASCII locale names that can't be safely saved-and-restored using C
+ * strings, but just in case we see one here, we'll log a warning.
+ */
+ if (!pg_is_ascii(save))
+ elog(WARNING, "locale name \"%s\" contains non-ASCII characters", save);
+
/* save may be pointing at a modifiable scratch variable, see above. */
save = pstrdup(save);
@@ -356,6 +375,18 @@ check_locale(int category, const char *locale, char **canonname)
elog(WARNING, "failed to restore old locale \"%s\"", save);
pfree(save);
+ /* Don't let Windows' non-ASCII locale names out. */
+ if (canonname && *canonname && !pg_is_ascii(*canonname))
+ {
+ ereport(WARNING,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("locale name \"%s\" contains non-ASCII characters",
+ *canonname)));
+ pfree(*canonname);
+ *canonname = NULL;
+ return false;
+ }
+
return (res != NULL);
}
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index f00718a0150..03f16947416 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -2132,18 +2132,42 @@ locale_date_order(const char *locale)
static void
check_locale_name(int category, const char *locale, char **canonname)
{
+#ifdef WIN32
+ wchar_t *save;
+#else
char *save;
+#endif
char *res;
+ /* Don't let Windows' non-ASCII locales names in. */
+ if (locale && !pg_is_ascii(locale))
+ pg_fatal("locale name \"%s\" contains non-ASCII characters", locale);
+
if (canonname)
*canonname = NULL; /* in case of failure */
+ /*
+ * We can't save-and-restore Windows' non-ASCII locales safely unless we
+ * use the wchar_t variant, because the locale we switch to might change
+ * the expected encoding of "save" when we restore.
+ */
+#ifdef WIN32
+ save = _wsetlocale(category, NULL);
+ if (!save)
+ pg_fatal("_wsetlocale() failed");
+
+ /* save may be pointing at a modifiable scratch variable, so copy it. */
+ save = wcsdup(save);
+ if (save == NULL)
+ pg_fatal("out of memory");
+#else
save = setlocale(category, NULL);
if (!save)
- pg_fatal("setlocale() failed");
+ pg_fatal("wsetlocale() failed");
/* save may be pointing at a modifiable scratch variable, so copy it. */
save = pg_strdup(save);
+#endif
/* for setlocale() call */
if (!locale)
@@ -2157,8 +2181,13 @@ check_locale_name(int category, const char *locale, char **canonname)
*canonname = pg_strdup(res);
/* restore old value. */
+#ifdef WIN32
+ if (!_wsetlocale(category, NULL))
+ pg_fatal("failed to restore old locale");
+#else
if (!setlocale(category, save))
pg_fatal("failed to restore old locale \"%s\"", save);
+#endif
free(save);
/* complain if locale wasn't valid */
@@ -2183,6 +2212,13 @@ check_locale_name(int category, const char *locale, char **canonname)
pg_fatal("invalid locale settings; check LANG and LC_* environment variables");
}
}
+
+ /*
+ * Don't let Windows' non-ASCII locales out, in the unlikely event that an
+ * ASCII input name was canonicalized to a non-ASCII name.
+ */
+ if (canonname && !pg_is_ascii(*canonname))
+ pg_fatal("locale name \"%s\" contains non-ASCII characters", locale);
}
/*
--
2.46.0
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-09-04 21:28 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-09-04 21:28 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Andrew Dunstan <andrew@dunslane.net>; +Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Hi Thomas,
How is it going after all the analysis below?
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Thursday, August 29, 2024 8:22 PM
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Fri, Aug 30, 2024 at 10:55 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Fri, Aug 30, 2024 at 3:16 AM Andrew Dunstan <andrew@dunslane.net> wrote:
> > On 2024-08-28 We 6:16 AM, Thomas Munro wrote:
> > > initdb: error: locale name "liberté" contains non-ASCII characters
> >
> > +1 for doing this.
>
> Thanks for looking! OK, let's go with this approach. That two-line
> demo patch doesn't work properly for the system default, and of course
> it should be in sync with the backend function, and needs comments to
> explain this mess, so I'll work on a serious patch.
Done. To develop this patch, I set up a cursed locale name on my FreeBSD box like so:
$ sudo cp -r /usr/share/locale/fr_FR.UTF-8 /usr/share/locale/fraternité.UTF-8
Then I could exercise the setlocale("") path, approximating what I expect a Turkish Windows system to do without explicit --locale:
$ LC_TIME="fraternité.UTF-8" initdb -D pdata ...
initdb: error: locale name "fraternité.UTF-8" contains non-ASCII characters
The explicit path is easier to test, like before:
$ initdb -D pgdata --locale "égalité.UTF-9"
...
initdb: error: locale name "égalité.UTF-9" contains non-ASCII characters
That's what the EDB installer (if not changed to provide ASCII-clean names somehow or other) will start failing with, if it tries to feed umlauts to initdb.
Working through that, I understood another problem: even if you provide an acceptable string like --locale "tr-TR", we still need to be able to save-and-restore the value that initdb inherited from the environment. Using my simulation, what I mean is if you do:
$ export LANG="liberté.UTF-8"
... then ...
$ initdb -D pgdata --locale "fr_FR.UTF-8"
... it still needs to be able to do a safe save-and-restore back to the environment's value without crashing, even though it's not really using that value. I wondered if initdb really needs a locale other than "C" for itself, but I'm trying to minimise the changes here so I
don't break something else... That seems to mean that we have to use
_wsetlocale() for that particular save/restore. This is essentially what Haifang's colleagues were suggesting upthread. Done.
Once a server is up and running, we shouldn't be exposed to the server environment (right?), but there are several more places that accept user-supplied strings, and only CREATE COLLATION fails to run
check_locale():
postgres=# create collation foo (locale = 'fraternité.UTF-8'); CREATE COLLATION
The other places I am aware of do, so putting the equivalent code into
check_locale() does the right thing:
postgres=# create database db locale = 'fraternité.UTF-8';
WARNING: locale name "fraternité.UTF-8" contains non-ASCII characters
ERROR: invalid LC_COLLATE locale name: "fraternité.UTF-8"
HINT: If the locale name is specific to ICU, use ICU_LOCALE.
postgres=# set lc_time = 'fraternité.UTF-8';
WARNING: locale name "fraternité.UTF-8" contains non-ASCII characters
ERROR: invalid value for parameter "lc_time": "fraternité.UTF-8"
postgres=# set lc_messages = 'fraternité.UTF-8';
WARNING: locale name "fraternité.UTF-8" contains non-ASCII characters
ERROR: invalid value for parameter "lc_messages": "fraternité.UTF-8"
postgres=# set lc_monetary = 'fraternité.UTF-8';
WARNING: locale name "fraternité.UTF-8" contains non-ASCII characters
ERROR: invalid value for parameter "lc_monetary": "fraternité.UTF-8"
Those last SET lc_* changes aren't strictly necessary, because we never restore to those, we only switch to them and then restore to the database default, but since they share code with CREATE DATABASE the new check kicks in anyway.
I tried adding check_locale() checks into CREATE COLLATION, but that made some tests fail (huh, I didn't know that the set of strings acceptable to _newlocale() and setlocale() are different -- the former seems to accept "POSIX" on that OS, which is exercised by some tests, or maybe it's some path of ours, I didn't check). But, on reflection, I don't believe that COLLATION objects actually have this problem anyway, because we never call setlocale() to them, we just use the modern thread-safe POSIX-2008-oid APIs. So I took that back out to minimise the patch.
Please see attached, including a restatement of the problem and solution in the commit message.
I suppose we could add some tests for this, but I was a bit unsure about the rules for putting non-ASCII into perl scripts and command lines, and would need to research that...
(Note: a lot of this old stuff is getting ripped out in master by the ongoing multi-threading effort...)
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-09-04 21:41 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-09-04 21:41 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Thu, Sep 5, 2024 at 9:28 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> How is it going after all the analysis below?
I proposed a patch. I am waiting for someone to try it out, review it
and write the magic words "looks good to me", before I commit it and
back-patch it. PostgreSQL will next make a release in early November.
Shortly after that, the EDB Windows installer team would begin
publishing a new Windows installer package, and then you should stop
hearing from Windows users whose runtime library exploded. Hopefully
they will also adjust their GUI that offers a list of locale names to
users, so that it doesn't even offer the ones that don't work, and
does offer some better ones, like (probably) "tr-TR.UTF-8".
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-09-04 22:07 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-09-04 22:07 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Cool. is anyone going to try it out? Looking forward to the back-patch and release.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Wednesday, September 4, 2024 2:41 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Thu, Sep 5, 2024 at 9:28 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> How is it going after all the analysis below?
I proposed a patch. I am waiting for someone to try it out, review it and write the magic words "looks good to me", before I commit it and back-patch it. PostgreSQL will next make a release in early November.
Shortly after that, the EDB Windows installer team would begin publishing a new Windows installer package, and then you should stop hearing from Windows users whose runtime library exploded. Hopefully they will also adjust their GUI that offers a list of locale names to users, so that it doesn't even offer the ones that don't work, and does offer some better ones, like (probably) "tr-TR.UTF-8".
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-09-04 22:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Tom Lane @ 2024-09-04 22:10 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Thomas Munro <thomas.munro@gmail.com>; Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
"Haifang Wang (Centific Technologies Inc)" <v-haiwang@microsoft.com> writes:
> Cool. is anyone going to try it out? Looking forward to the back-patch and release.
I thought the implication was pretty clear that YOU ought to try it out.
regards, tom lane
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
@ 2024-09-04 22:35 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-09-04 22:35 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Thu, Sep 5, 2024 at 10:10 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Haifang Wang (Centific Technologies Inc)" <v-haiwang@microsoft.com> writes:
> > Cool. is anyone going to try it out? Looking forward to the back-patch and release.
>
> I thought the implication was pretty clear that YOU ought to try it out.
It would also be good to hear from Sandeep and crew, if possible,
since they will be dealing with the consequences of this change.
But here is one thing Haifang might like to consider: the
documentation[1] for setlocale() could really use a note in the
remarks section to highlight this danger. Nothing in there seems to
alert the programmer to the fact that save = setlocale(NULL),
setlocale("something else"), setlocale(save) might fail to restore the
previous locale, and might even abort. Perhaps that's a weird, old,
non-thread-safe thing to be doing (and we're working on removing
that), but it is quite explicitly described in the standard. C99
7.11.1.1 paragraph 8: "The pointer to string returned by the setlocale
function is such that a subsequent call with that string value and its
associated category will restore that part of the program’s locale".
Aborting also fails paragraph 6: "If the selection cannot be honored,
the setlocale function returns a null pointer and the program’s locale
is not changed" (perhaps this has to do with the crt report mode
stuff, I don't know as I'm not a Windows programmer, I'm just trying
to maintain a C program; or maybe it's actually a bug?). Another
thing is that setlocale(NULL) continues to return the "old style"
names while everything else in the OS is using the modern BCP 47
system since Vista, and the locale documentation recommends that
applications prefer those[2]. It might be worth a note about that
too? (I guess stability and backwards compatibility are behind that
choice, but ... it's not really stable anyway.)
[1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-170
[2] https://learn.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-st...
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-09-04 23:24 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:38 ` Windows Application Issues | PostgreSQL | REF # 48475607 David G. Johnston <david.g.johnston@gmail.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 2 replies; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-09-04 23:24 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Okay, I will ask our tester to try the patch. But have you tried it from your end? @Thomas Munro @Tom Lane
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Wednesday, September 4, 2024 3:35 PM
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Thu, Sep 5, 2024 at 10:10 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Haifang Wang (Centific Technologies Inc)" <v-haiwang@microsoft.com> writes:
> > Cool. is anyone going to try it out? Looking forward to the back-patch and release.
>
> I thought the implication was pretty clear that YOU ought to try it out.
It would also be good to hear from Sandeep and crew, if possible, since they will be dealing with the consequences of this change.
But here is one thing Haifang might like to consider: the documentation[1] for setlocale() could really use a note in the remarks section to highlight this danger. Nothing in there seems to alert the programmer to the fact that save = setlocale(NULL), setlocale("something else"), setlocale(save) might fail to restore the previous locale, and might even abort. Perhaps that's a weird, old, non-thread-safe thing to be doing (and we're working on removing that), but it is quite explicitly described in the standard. C99
7.11.1.1 paragraph 8: "The pointer to string returned by the setlocale function is such that a subsequent call with that string value and its associated category will restore that part of the program’s locale".
Aborting also fails paragraph 6: "If the selection cannot be honored, the setlocale function returns a null pointer and the program’s locale is not changed" (perhaps this has to do with the crt report mode stuff, I don't know as I'm not a Windows programmer, I'm just trying to maintain a C program; or maybe it's actually a bug?). Another thing is that setlocale(NULL) continues to return the "old style"
names while everything else in the OS is using the modern BCP 47 system since Vista, and the locale documentation recommends that applications prefer those[2]. It might be worth a note about that too? (I guess stability and backwards compatibility are behind that choice, but ... it's not really stable anyway.)
[1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-170
[2] https://learn.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-st...
^ permalink raw reply [nested|flat] 73+ messages in thread
* Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-09-04 23:38 ` David G. Johnston <david.g.johnston@gmail.com>
1 sibling, 0 replies; 73+ messages in thread
From: David G. Johnston @ 2024-09-04 23:38 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Thomas Munro <thomas.munro@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Wednesday, September 4, 2024, Haifang Wang (Centific Technologies Inc) <
v-haiwang@microsoft.com> wrote:
> Okay, I will ask our tester to try the patch. But have you tried it from
> your end? @Thomas Munro @Tom Lane
>
Thomas wrote that he authored it so you can safely assume it was tested by
him. Tom Lane is not on the hook to be a reviewer here - especially given
his total involvement to date was only a single reply a while ago. Tom as
a committer could pick up the patch and commit it as a neutral party
committer once the others involved on this thread provide some reviews;
though given this is Windows-based I wouldn’t expect Tom to do that here.
David J.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-09-04 23:39 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
1 sibling, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-09-04 23:39 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Thu, Sep 5, 2024 at 11:24 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Okay, I will ask our tester to try the patch. But have you tried it from your end? @Thomas Munro @Tom Lane
I demonstrated it working on my computer in the email:
https://www.postgresql.org/message-id/CA%2BhUKG%2B28zRyk8U%3DeFLn8O%2B17VrbpKykWPVrSzf57Ru32dQo8A%40...
But I can't test on Windows. For context, I have a "UNIX -- Live Free
or Die" license plate attached to the side of my workstation.
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-09-05 00:07 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-09-05 00:07 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Good to know that, Thomas. I'm asking our tester to try it. Will let you know.
Regards!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Wednesday, September 4, 2024 4:39 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Thu, Sep 5, 2024 at 11:24 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Okay, I will ask our tester to try the patch. But have you tried it
> from your end? @Thomas Munro @Tom Lane
I demonstrated it working on my computer in the email:
https://www.postgresql.org/message-id/CA%2BhUKG%2B28zRyk8U%3DeFLn8O%2B17VrbpKykWPVrSzf57Ru32dQo8A%40...
But I can't test on Windows. For context, I have a "UNIX -- Live Free or Die" license plate attached to the side of my workstation.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-09-05 00:15 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-05 11:46 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-09-05 00:15 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Thu, Sep 5, 2024 at 12:07 PM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Good to know that, Thomas. I'm asking our tester to try it. Will let you know.
To give a more serious response, I don't really expect anything
"simple" about this patch not to work on Windows, as I know that it it
rejects non-ASCII names as I showed (on all OSes), and I know that
compiles and passes our tests on all our 4 CI operating systems:
https://cirrus-ci.com/build/4941642090676224
Really what I'm looking for is (1) feedback on the approach, code and
comments, and thoughts about more complex scenarios I may have failed
to think about, including say, pg_dump, pg_upgrade etc operational
issues, which probably involves lots of previous experience with
PostgreSQL, (2) opinions on whether we should add a test for these
cases and how to put the UTF-8 into a script (I'm confused about the
encoding of command line arguments), and (3) a nod from the EDB people
involved in distributing this software on Windows.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-09-05 11:46 ` Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-09-05 17:18 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-19 23:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 2 replies; 73+ messages in thread
From: Sandeep Thakkar @ 2024-09-05 11:46 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Thu, Sep 5, 2024 at 5:46 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Thu, Sep 5, 2024 at 12:07 PM Haifang Wang (Centific Technologies
> Inc) <v-haiwang@microsoft.com> wrote:
> > Good to know that, Thomas. I'm asking our tester to try it. Will let you
> know.
>
> To give a more serious response, I don't really expect anything
> "simple" about this patch not to work on Windows, as I know that it it
> rejects non-ASCII names as I showed (on all OSes), and I know that
> compiles and passes our tests on all our 4 CI operating systems:
>
> https://cirrus-ci.com/build/4941642090676224
>
> Really what I'm looking for is (1) feedback on the approach, code and
> comments, and thoughts about more complex scenarios I may have failed
> to think about, including say, pg_dump, pg_upgrade etc operational
> issues, which probably involves lots of previous experience with
> PostgreSQL, (2) opinions on whether we should add a test for these
> cases and how to put the UTF-8 into a script (I'm confused about the
> encoding of command line arguments), and (3) a nod from the EDB people
> involved in distributing this software on Windows.
>
We can help with producing the builds with the patches provided. You had
also
mentioned about the changes required in the installer script, will it still
be required?
--
Sandeep Thakkar
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 11:46 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
@ 2024-09-05 17:18 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
1 sibling, 0 replies; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-09-05 17:18 UTC (permalink / raw)
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Thomas Munro <thomas.munro@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
@Sandeep Thakkar<mailto:sandeep.thakkar@enterprisedb.com>, I believe your question is to Thomas, is that right?
@Thomas Munro<mailto:thomas.munro@gmail.com> regarding the patch you shared previously, could you give some instruction on how to use it?
Thanks!
Haifang
From: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
Sent: Thursday, September 5, 2024 4:47 AM
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Thu, Sep 5, 2024 at 5:46 AM Thomas Munro <thomas.munro@gmail.com<mailto:thomas.munro@gmail.com>> wrote:
On Thu, Sep 5, 2024 at 12:07 PM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com<mailto:v-haiwang@microsoft.com>> wrote:
> Good to know that, Thomas. I'm asking our tester to try it. Will let you know.
To give a more serious response, I don't really expect anything
"simple" about this patch not to work on Windows, as I know that it it
rejects non-ASCII names as I showed (on all OSes), and I know that
compiles and passes our tests on all our 4 CI operating systems:
https://cirrus-ci.com/build/4941642090676224
Really what I'm looking for is (1) feedback on the approach, code and
comments, and thoughts about more complex scenarios I may have failed
to think about, including say, pg_dump, pg_upgrade etc operational
issues, which probably involves lots of previous experience with
PostgreSQL, (2) opinions on whether we should add a test for these
cases and how to put the UTF-8 into a script (I'm confused about the
encoding of command line arguments), and (3) a nod from the EDB people
involved in distributing this software on Windows.
We can help with producing the builds with the patches provided. You had also
mentioned about the changes required in the installer script, will it still be required?
--
Sandeep Thakkar
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 11:46 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
@ 2024-09-19 23:37 ` Thomas Munro <thomas.munro@gmail.com>
2024-10-05 01:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
1 sibling, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-09-19 23:37 UTC (permalink / raw)
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Thu, Sep 5, 2024 at 11:46 PM Sandeep Thakkar
<sandeep.thakkar@enterprisedb.com> wrote:
> On Thu, Sep 5, 2024 at 5:46 AM Thomas Munro <thomas.munro@gmail.com> wrote:
>> Really what I'm looking for is (1) feedback on the approach, code and
>> comments, and thoughts about more complex scenarios I may have failed
>> to think about, including say, pg_dump, pg_upgrade etc operational
>> issues, which probably involves lots of previous experience with
>> PostgreSQL, (2) opinions on whether we should add a test for these
>> cases and how to put the UTF-8 into a script (I'm confused about the
>> encoding of command line arguments), and (3) a nod from the EDB people
>> involved in distributing this software on Windows.
If I don't hear any objections to this plan soon, I'm going to commit
this and back-patch it into PostgreSQL 16 and PostgreSQL 17 after the
upcoming code freeze for the PostgreSQL 17 release ends. So it'll
probably be in 16.5 and 17.1.
> We can help with producing the builds with the patches provided. You had also
> mentioned about the changes required in the installer script, will it still be required?
If you don't change the installer script, then it will still fail if
someone selects "Türkiye" in your GUI, but now it will fail with an
ERROR rejecting non-ASCII characters, instead of crashing. So people
in Türkiye, Côte d'Ivoire, Curaçao etc will still have no way to
initialise a cluster with your GUI in PostgreSQL 16.5 and 17.1 unless
they follow the instructions on the web to create a "Turkey" (or
whatever non-ASCII string they want). Of course they could always use
initdb.exe directly from the command line with a BCP47 name. Maybe
that's OK, but I think you should consider changing the installer. A
conservative way to do it would be to show all the existing options
that you have now (so that someone who is happy using the old style
names when they don't contain non-ASCII can keep doing so), but also
have a second entry for each country that shows "Turkish, Türkiye
(tr-TR)" and/or perhaps "Turkish, Türkiye (tr-TR.UTF-8)" or perhaps
both, and passes just that part in parentheses to initdb, to give
users all the options. Or perhaps you could have a checkbox "BCP 47
locales" that changes the list to show them.
No one has really reported any real world experience choosing between
the tr-TR vs tr-TR.UTF-8 alternatives, and you might like to
experiment with that. The second option makes Windows' system
libraries use UTF-8 encoding instead of the traditional encoding
associated with the language. As far as I can tell, it doesn't make
any difference at all to PostgreSQL yet, because your installer always
uses --encoding="UTF8" and, on Windows only, that makes PostgreSQL
ignore the locale's encoding and do a whole lot of internal
conversation to wchar_t because PostgreSQL doesn't yet know that
Windows 10+ can work with UTF-8 directly.
The reason that I am interested in this .UTF-8-or-not question is that
I'd like to consider *disallowing* non-matching encodings (see
commitfest entry #3772, reviewers wanted!), and teaching PostgreSQL
that Windows does in fact have UTF-8, just so we can delete a lot of
slow special case code, harmonise with Unix, and generally catch up
with reality. So I figure we might as well start encouraging the
"xx-XX.UTF-8" names when using --encoding="UTF8" if we can't find any
downside, because under that plan it would eventually become illegal
to use --locale="tr-TR" (no .UTF-8) with --encoding="UTF-8" if that
eventually goes in, so it seems sensible to stop creating new clusters
that way ASAP so that users have a better time upgrading in the
future. For example, a pg_upgrade from a PostgreSQL 17 cluster
initialised with --locale="tr-TR" --encoding="UTF8" to PostgreSQL 18
would proabbly require some extra step to rename "tr-TR" to
"tr-TR.UTF8" at some point (not sure exactly where), if PostgreSQL 18
starts rejecting the non-matching combination. I don't know where
that'll go, though -- it's not high priority work, it's just
incremental cleanup and modernisation that practically suggests itself
whenever looking at rejigging locale code for thread-safety and
reading all those comments about wchar_t that are not true.
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 11:46 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-09-19 23:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-10-05 01:16 ` Thomas Munro <thomas.munro@gmail.com>
2024-11-11 23:12 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-10-05 01:16 UTC (permalink / raw)
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Fri, Sep 20, 2024 at 11:37 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> If I don't hear any objections to this plan soon, I'm going to commit
> this and back-patch it into PostgreSQL 16 and PostgreSQL 17 after the
> upcoming code freeze for the PostgreSQL 17 release ends. So it'll
> probably be in 16.5 and 17.1.
Done, after another round of polishing and testing.
The main change since v2 was: I realised that initdb's
locale_date_order() also contains a save-and-restore, which should
share code at least for consistency (I don't personally know which
categories really affect process-wide encoding assumptions, so this
might not technically be necessary). I moved the relevant code into
new helper functions, which I think came out tidier.
The wchar_t-based save-restore in initdb.exe is based on a theoretical
observation, as the report was about postgres.exe crashing and that
should now be unreachable with these new name checks, but we can see
the general phenomenon from a two-line standalone repro[1] and so I
suspect there must be environment/input combinations that could crash
initdb.exe itself without it. We don't have any concrete reports of
that, but I preferred to close the theoretical risk using the
recommended technique.
Sorry for taking so long to untangle this mess; I assumed for much of
the thread that we were talking about the failure of existing clusters
to come up (as complained about in numerous other threads), not this
new kind of crash, and was trying to fix that before the Locale
Builder solution was widely known. Fixing Windows bugs as a
non-Windows guy by reading the manual and testing patches on CI can
sometimes feel a little like trying to patch a Mars rover... Thanks
to David R for help with a crucial observation using a martian
debugger.
CREATE COLLATION should probably also start using check_locale()
eventually, and I may look into harmonising that and figure out how to
test it in nearby future work on locales vs threads.
[1] https://www.postgresql.org/message-id/CA+hUKG+FxeRLURZ=n8NPyLwgjFds_SqU_cQvE40ks6RQKUGbGg@mail.gmail...
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 11:46 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-09-19 23:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-10-05 01:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-11-11 23:12 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-11-12 00:42 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-11-11 23:12 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Hi Thomas and team,
Just would like to follow up with you about this bug. Is the bug fix available? We noticed that there is a new build 17.0-1. However the issue repro on that build too.
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Friday, October 4, 2024 6:17 PM
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
Cc: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Fri, Sep 20, 2024 at 11:37 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> If I don't hear any objections to this plan soon, I'm going to commit
> this and back-patch it into PostgreSQL 16 and PostgreSQL 17 after the
> upcoming code freeze for the PostgreSQL 17 release ends. So it'll
> probably be in 16.5 and 17.1.
Done, after another round of polishing and testing.
The main change since v2 was: I realised that initdb's
locale_date_order() also contains a save-and-restore, which should share code at least for consistency (I don't personally know which categories really affect process-wide encoding assumptions, so this might not technically be necessary). I moved the relevant code into new helper functions, which I think came out tidier.
The wchar_t-based save-restore in initdb.exe is based on a theoretical observation, as the report was about postgres.exe crashing and that should now be unreachable with these new name checks, but we can see the general phenomenon from a two-line standalone repro[1] and so I suspect there must be environment/input combinations that could crash initdb.exe itself without it. We don't have any concrete reports of that, but I preferred to close the theoretical risk using the recommended technique.
Sorry for taking so long to untangle this mess; I assumed for much of the thread that we were talking about the failure of existing clusters to come up (as complained about in numerous other threads), not this new kind of crash, and was trying to fix that before the Locale Builder solution was widely known. Fixing Windows bugs as a non-Windows guy by reading the manual and testing patches on CI can sometimes feel a little like trying to patch a Mars rover... Thanks to David R for help with a crucial observation using a martian debugger.
CREATE COLLATION should probably also start using check_locale() eventually, and I may look into harmonising that and figure out how to test it in nearby future work on locales vs threads.
[1] https://www.postgresql.org/message-id/CA+hUKG+FxeRLURZ=n8NPyLwgjFds_SqU_cQvE40ks6RQKUGbGg@mail.gmail...
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 11:46 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-09-19 23:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-10-05 01:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-11-11 23:12 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
@ 2024-11-12 00:42 ` Thomas Munro <thomas.munro@gmail.com>
2024-11-12 00:50 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 1 reply; 73+ messages in thread
From: Thomas Munro @ 2024-11-12 00:42 UTC (permalink / raw)
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>; +Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
On Tue, Nov 12, 2024 at 12:12 PM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Just would like to follow up with you about this bug. Is the bug fix available? We noticed that there is a new build 17.0-1. However the issue repro on that build too.
Hi Haifang,
The change is in v17.1 and v16.5, but the release process for those is
in progress right now, getting them out to the packaging teams.
Hopefully new Windows installer packages will appear in a few days or
so?
^ permalink raw reply [nested|flat] 73+ messages in thread
* RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-29 15:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-09-05 11:46 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-09-19 23:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-10-05 01:16 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-11-11 23:12 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-11-12 00:42 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
@ 2024-11-12 00:50 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
0 siblings, 0 replies; 73+ messages in thread
From: Haifang Wang (Centific Technologies Inc) @ 2024-11-12 00:50 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Great to hear that, Thomas. Looking forward to hearing from your once the new release is available.
Thanks!
Haifang
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Monday, November 11, 2024 4:43 PM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Tom Lane <tgl@sss.pgh.pa.us>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey <pandeyrah@microsoft.com>; Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy Wishnousky <amyw@microsoft.com>; pgsql-bugs@lists.postgresql.org; Shweta Gulati <gulatishweta@microsoft.com>; Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Nov 12, 2024 at 12:12 PM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Just would like to follow up with you about this bug. Is the bug fix available? We noticed that there is a new build 17.0-1. However the issue repro on that build too.
Hi Haifang,
The change is in v17.1 and v16.5, but the release process for those is in progress right now, getting them out to the packaging teams.
Hopefully new Windows installer packages will appear in a few days or so?
^ permalink raw reply [nested|flat] 73+ messages in thread
* Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-06-25 11:51 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 11:54 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
@ 2024-08-08 23:45 ` Thomas Munro <thomas.munro@gmail.com>
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Munro @ 2024-08-08 23:45 UTC (permalink / raw)
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Wed, Jul 31, 2024 at 9:53 PM Sandeep Thakkar
<sandeep.thakkar@enterprisedb.com> wrote:
> On Thu, Jul 25, 2024 at 11:39 AM Thomas Munro <thomas.munro@gmail.com> wrote:
>> On Tue, Jul 23, 2024 at 12:12 AM Sandeep Thakkar
>> <sandeep.thakkar@enterprisedb.com> wrote:
>> . o O { I wonder if it could ever be possible to have that automated
>> via CI. Imagine if I/anyone could clone the EDB installer github
>> repo, and push a small patch into a private branch that tells it where
>> to pull PostgreSQL sources from, including any public git branch
>> including commitfest ones, and some options like with/without
>> assertions, and have CI spit out a new installer as an artifact?
>> Hopefully non-REL_XXX_STABLE branches would have a big warning on the
>> GUI so that users would never accidentally think it's a real release.
>> }
>
> yeah, that'll be helpful but unfortunately it's not possible atm. Hopefully, we will
> have that available in future through the GitHub actions.
Sounds great.
FWIW it's easy[1][2] to make the PostgreSQL CI spit out a zip file
with a snapshot build of PostgreSQL. I expect it doesn't actually run
on a real Windows system unless you also install DLLs it needs like
OpenSSL, ICU etc, and I'm not sure if that would be best done by
stuffing them too into the .zip file, or if the scripts[3] that the CI
images are prepared with should be used by someone who wants to test
it. But thinking about that leads me back to the thought that it'd be
better if people interested in trying pre-releases could get an EDB
installer for a snapshot build from any branch anywhere, so it all
works the way they will actually use it in real life. And of course
you guys already did all the hard work to deal with dependencies.
[1] https://github.com/macdice/postgres/commit/56e967f9cd35ef418a653d191a4d9ea85055d94b
[2] https://cirrus-ci.com/task/4831619775725568
[3] https://github.com/anarazel/pg-vm-images/tree/main/scripts
^ permalink raw reply [nested|flat] 73+ messages in thread
end of thread, other threads:[~2024-11-12 00:50 UTC | newest]
Thread overview: 73+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 17:26 Windows Application Issues | PostgreSQL | REF # 48475607 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-02 23:50 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-02 23:53 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-13 18:51 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 21:50 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:11 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-13 22:27 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-13 22:47 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-13 23:07 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-05-13 23:09 ` John McKown <john.archie.mckown@gmail.com>
2024-05-13 23:15 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-05-14 06:38 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-15 23:46 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-17 22:25 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-18 05:39 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-18 05:47 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-05-18 05:56 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-20 20:17 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-20 20:56 ` Thomas Munro <thomas.munro@gmail.com>
2024-05-20 23:32 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-05-21 08:27 ` Vishwa Deepak <Vishwa.Deepak@microsoft.com>
2024-05-22 11:37 ` Rahul Pandey <pandeyrah@microsoft.com>
2024-05-28 18:21 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 13:00 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-03 21:22 ` Thomas Munro <thomas.munro@gmail.com>
2024-06-03 22:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-06-04 00:13 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-05 06:20 ` Thomas Munro <thomas.munro@gmail.com>
2024-06-04 00:09 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-05 09:10 ` Rahul Pandey <pandeyrah@microsoft.com>
2024-06-06 23:39 ` Thomas Munro <thomas.munro@gmail.com>
2024-06-13 18:46 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-17 21:06 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-24 22:07 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-06-25 11:51 ` Thomas Munro <thomas.munro@gmail.com>
2024-06-25 22:24 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-07-05 22:00 ` Windows Application Issues | PostgreSQL | REF # 51961374 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-07-07 07:16 ` Re: Windows Application Issues | PostgreSQL | REF # 51961374 Thomas Munro <thomas.munro@gmail.com>
2024-07-08 15:52 ` RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 51961374 Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-07-21 11:54 ` Thomas Munro <thomas.munro@gmail.com>
2024-07-21 13:28 ` Andrew Dunstan <andrew@dunslane.net>
2024-07-21 22:00 ` Thomas Munro <thomas.munro@gmail.com>
2024-07-22 11:24 ` Andrew Dunstan <andrew@dunslane.net>
2024-07-22 12:12 ` Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-07-25 06:08 ` Thomas Munro <thomas.munro@gmail.com>
2024-07-31 09:53 ` Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-08-08 02:35 ` Thomas Munro <thomas.munro@gmail.com>
2024-08-26 21:29 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-28 10:16 ` Thomas Munro <thomas.munro@gmail.com>
2024-08-28 19:34 ` Shawn Steele <Shawn.Steele@microsoft.com>
2024-08-29 15:16 ` Andrew Dunstan <andrew@dunslane.net>
2024-08-29 17:53 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-29 21:09 ` Andrew Dunstan <andrew@dunslane.net>
2024-08-29 22:55 ` Thomas Munro <thomas.munro@gmail.com>
2024-08-30 03:22 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-04 21:28 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 21:41 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-04 22:07 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 22:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-09-04 22:35 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-04 23:24 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-04 23:38 ` David G. Johnston <david.g.johnston@gmail.com>
2024-09-04 23:39 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-05 00:07 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-05 00:15 ` Thomas Munro <thomas.munro@gmail.com>
2024-09-05 11:46 ` Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2024-09-05 17:18 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-09-19 23:37 ` Thomas Munro <thomas.munro@gmail.com>
2024-10-05 01:16 ` Thomas Munro <thomas.munro@gmail.com>
2024-11-11 23:12 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-11-12 00:42 ` Thomas Munro <thomas.munro@gmail.com>
2024-11-12 00:50 ` Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
2024-08-08 23:45 ` Thomas Munro <thomas.munro@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox