Re: WIN32 pg_import_system_collations

2023-03-01 Thread Juan José Santamaría Flecha
On Tue, Feb 28, 2023 at 9:26 PM Andrew Dunstan wrote: > I think you missed my point, which was that the COLLATE clause above > seemed particularly pointless. But I agree that all these are not much use, > so I'll remove them as you suggest. > Maybe there has been some miscommunication, please

Re: WIN32 pg_import_system_collations

2023-02-28 Thread Andrew Dunstan
On 2023-02-28 Tu 11:40, Juan José Santamaría Flecha wrote: On Tue, Feb 28, 2023 at 12:55 PM Andrew Dunstan wrote: On 2023-02-27 Mo 17:20, Juan José Santamaría Flecha wrote: Hmm, yeah. I'm not sure I understand the point of this test anyway: SELECT to_char(date '2010-03-01',

Re: WIN32 pg_import_system_collations

2023-02-28 Thread Juan José Santamaría Flecha
On Tue, Feb 28, 2023 at 12:55 PM Andrew Dunstan wrote: > On 2023-02-27 Mo 17:20, Juan José Santamaría Flecha wrote: > > > Hmm, yeah. I'm not sure I understand the point of this test anyway: > > > SELECT to_char(date '2010-03-01', 'DD TMMON ' COLLATE "de_DE"); > Uhm, they probably don't make

Re: WIN32 pg_import_system_collations

2023-02-28 Thread Andrew Dunstan
On 2023-02-27 Mo 17:20, Juan José Santamaría Flecha wrote: El lun, 27 feb 2023, 23:05, Juan José Santamaría Flecha escribió: The command that's failing is "SET lc_time TO 'de_DE';", and that area of code is untouched by this patch. As mentioned in [1], the problem seems to

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Juan José Santamaría Flecha
El lun, 27 feb 2023, 23:05, Juan José Santamaría Flecha < juanjo.santama...@gmail.com> escribió: > > The command that's failing is "SET lc_time TO 'de_DE';", and that area of > code is untouched by this patch. As mentioned in [1], the problem seems to > come from a Windows bug that the CI images

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Juan José Santamaría Flecha
On Mon, Feb 27, 2023 at 1:10 PM Andrew Dunstan wrote: > On 2023-02-26 Su 16:02, Andrew Dunstan wrote: > > Now that I have removed the barrier to testing this in the buildfarm, and > added an appropriate locale setting to drongo, we can see that this test > fails like this: > > > diff -w -U3 >

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Andrew Dunstan
On 2023-02-26 Su 16:02, Andrew Dunstan wrote: On 2023-01-03 Tu 08:48, Peter Eisentraut wrote: On 09.12.22 13:48, Juan José Santamaría Flecha wrote: On Thu, Dec 1, 2022 at 8:46 AM Peter Eisentraut > wrote:     What is the status of this now?  I

Re: WIN32 pg_import_system_collations

2023-02-26 Thread Andrew Dunstan
On 2023-01-03 Tu 08:48, Peter Eisentraut wrote: On 09.12.22 13:48, Juan José Santamaría Flecha wrote: On Thu, Dec 1, 2022 at 8:46 AM Peter Eisentraut > wrote:     What is the status of this now?  I think the other issue has been     addressed?

Re: WIN32 pg_import_system_collations

2023-01-03 Thread Peter Eisentraut
On 09.12.22 13:48, Juan José Santamaría Flecha wrote: On Thu, Dec 1, 2022 at 8:46 AM Peter Eisentraut > wrote: What is the status of this now?  I think the other issue has been addressed? Yes, that's addressed for MSVC builds. I think there

Re: WIN32 pg_import_system_collations

2022-12-09 Thread Juan José Santamaría Flecha
E TYPE collate_dep_test2 AS (x int, y text COLLATE test0); +CREATE VIEW collate_dep_test3 AS SELECT text 'foo' COLLATE test0 AS foo; +CREATE TABLE collate_dep_test4t (a int, b text); +CREATE INDEX collate_dep_test4i ON collate_dep_test4t (b COLLATE test0); + +DROP COLLATION test0 RESTRICT; -- f

Re: WIN32 pg_import_system_collations

2022-11-30 Thread Peter Eisentraut
On 10.11.22 11:08, Juan José Santamaría Flecha wrote: This looks pretty good to me.  The refactoring of the non-Windows parts makes sense.  The Windows parts look reasonable on manual inspection, but again, I don't have access to Windows here, so someone

Re: WIN32 pg_import_system_collations

2022-11-10 Thread Juan José Santamaría Flecha
On Wed, Nov 9, 2022 at 12:02 AM Juan José Santamaría Flecha < juanjo.santama...@gmail.com> wrote: > On Mon, Nov 7, 2022 at 4:08 PM Peter Eisentraut < > peter.eisentr...@enterprisedb.com> wrote: > >> >> This looks pretty good to me. The refactoring of the non-Windows parts >> makes sense. The

Re: WIN32 pg_import_system_collations

2022-11-08 Thread Juan José Santamaría Flecha
On Mon, Nov 7, 2022 at 4:08 PM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > > This looks pretty good to me. The refactoring of the non-Windows parts > makes sense. The Windows parts look reasonable on manual inspection, > but again, I don't have access to Windows here, so

Re: WIN32 pg_import_system_collations

2022-11-07 Thread Peter Eisentraut
On 04.11.22 23:08, Juan José Santamaría Flecha wrote: Ok, I can definitely improve the comments for that function. Also consider describing in the commit message what you are doing in more detail, including some of the things that have been discussed in this thread. Going through

Re: WIN32 pg_import_system_collations

2022-11-04 Thread Juan José Santamaría Flecha
On Mon, Oct 31, 2022 at 3:09 PM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: Thanks for taking a look into this patch. > > Consider this function you are introducing: > > +/* > + * Create a collation if the input locale is valid for so. > + * Also keeps track of the number of

Re: WIN32 pg_import_system_collations

2022-10-31 Thread Peter Eisentraut
On 12.07.22 21:32, Juan José Santamaría Flecha wrote: Please find attached a rebased version. I have split the patch into two parts trying to make it easier to review, one with the code changes and the other with the test. Other than that, there are minimal changes from the previous version

Re: WIN32 pg_import_system_collations

2022-07-12 Thread Juan José Santamaría Flecha
Please find attached a rebased version. I have split the patch into two parts trying to make it easier to review, one with the code changes and the other with the test. Other than that, there are minimal changes from the previous version to the code due to the update of _WIN32_WINNT and enabling

Re: WIN32 pg_import_system_collations

2022-04-11 Thread Juan José Santamaría Flecha
On Tue, Mar 22, 2022 at 2:00 AM Andres Freund wrote: > > Currently fails to apply, please rebase: > http://cfbot.cputube.org/patch_37_3450.log > > Marked as waiting-on-author. > > Please, find attached a rebased version, no other significant change. Regards, Juan José Santamaría Flecha

Re: WIN32 pg_import_system_collations

2022-03-21 Thread Andres Freund
Hi, On 2022-01-25 15:49:01 +0100, Juan José Santamaría Flecha wrote: > So, I'm doing that in the attached version, just changing the object name. Currently fails to apply, please rebase: http://cfbot.cputube.org/patch_37_3450.log Marked as waiting-on-author. - Andres

Re: WIN32 pg_import_system_collations

2022-01-25 Thread Juan José Santamaría Flecha
On Tue, Jan 25, 2022 at 11:40 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 24.01.22 22:23, Dmitry Koval wrote: > Thanks for looking into this. > > +/* > > + * Windows will use hyphens between language and territory, where POSIX > > + * uses an underscore. Simply make it

Re: WIN32 pg_import_system_collations

2022-01-25 Thread Peter Eisentraut
On 24.01.22 22:23, Dmitry Koval wrote: +/* + * Windows will use hyphens between language and territory, where POSIX + * uses an underscore. Simply make it POSIX looking. + */ + hyphen = strchr(localebuf, '-'); + if (hyphen) +    *hyphen = '_'; After this block modified collation name is used in

Re: WIN32 pg_import_system_collations

2022-01-24 Thread Dmitry Koval
Hi Juan José, I a bit tested this feature and have small doubts about block: +/* + * Windows will use hyphens between language and territory, where POSIX + * uses an underscore. Simply make it POSIX looking. + */ + hyphen = strchr(localebuf, '-'); + if (hyphen) +*hyphen = '_'; After this

Re: WIN32 pg_import_system_collations

2022-01-24 Thread Dmitry Koval
Hi Juan José, I a bit tested this feature and have small doubts about block: +/* + * Windows will use hyphens between language and territory, where POSIX + * uses an underscore. Simply make it POSIX looking. + */ + hyphen = strchr(localebuf, '-'); + if (hyphen) +*hyphen = '_'; After this

Re: WIN32 pg_import_system_collations

2022-01-19 Thread Juan José Santamaría Flecha
On Wed, Jan 19, 2022 at 10:53 AM Julien Rouhaud wrote: > > This version doesn't apply anymore: > > Thanks for the heads up. Please find attached a rebased patch. I have also rewritten some comments to address previous reviews, code and test remain the same. Regards, Juan José Santamaría

Re: WIN32 pg_import_system_collations

2022-01-19 Thread Julien Rouhaud
Hi, On Mon, Dec 13, 2021 at 05:28:47PM +0100, Juan José Santamaría Flecha wrote: > On Mon, Dec 13, 2021 at 9:41 AM Juan José Santamaría Flecha < > juanjo.santama...@gmail.com> wrote: > > Per path tester. This version doesn't apply anymore: http://cfbot.cputube.org/patch_36_3450.log ===

Re: WIN32 pg_import_system_collations

2021-12-14 Thread Thomas Munro
On Wed, Dec 15, 2021 at 3:52 PM Michael Paquier wrote: > On Wed, Dec 15, 2021 at 10:45:28AM +1300, Thomas Munro wrote: > > Ah, right. I hope we can make the leap to 0x0A00 (Win10) soon and > > just stop thinking about these old ghosts, as mentioned by various > > people in various threads. > >

Re: WIN32 pg_import_system_collations

2021-12-14 Thread Michael Paquier
On Wed, Dec 15, 2021 at 10:45:28AM +1300, Thomas Munro wrote: > Ah, right. I hope we can make the leap to 0x0A00 (Win10) soon and > just stop thinking about these old ghosts, as mentioned by various > people in various threads. Seeing your message here.. My apologies for the short digression.

Re: WIN32 pg_import_system_collations

2021-12-14 Thread Thomas Munro
On Wed, Dec 15, 2021 at 9:14 AM Juan José Santamaría Flecha wrote: > What I meant to say is that to run the test, you need a database that has > successfully run pg_import_system_collations. This would be also possible in > Mingw for _WIN32_WINNT> = 0x0600, but the current value in >

Re: WIN32 pg_import_system_collations

2021-12-14 Thread Juan José Santamaría Flecha
On Mon, Dec 13, 2021 at 9:54 PM Thomas Munro wrote: > > I haven't tested yet but +1 for the feature. I guess the API didn't > exist at the time collation support was added. > > Good to hear. > This conversion makes sense, to keep the user experience the same > across platforms. Nitpick on

Re: WIN32 pg_import_system_collations

2021-12-13 Thread Thomas Munro
On Tue, Dec 14, 2021 at 5:29 AM Juan José Santamaría Flecha wrote: > On Mon, Dec 13, 2021 at 9:41 AM Juan José Santamaría Flecha > wrote: > Per path tester. Hi Juan José, I haven't tested yet but +1 for the feature. I guess the API didn't exist at the time collation support was added. +

Re: WIN32 pg_import_system_collations

2021-12-13 Thread Juan José Santamaría Flecha
On Mon, Dec 13, 2021 at 9:41 AM Juan José Santamaría Flecha < juanjo.santama...@gmail.com> wrote: Per path tester. > Regards, > > Juan José Santamaría Flecha > v2-0001-WIN32-pg_import_system_collations.patch Description: Binary data

WIN32 pg_import_system_collations

2021-12-13 Thread Juan José Santamaría Flecha
ddf3114e82dc32edb59278d9ed2cb995222a5adf Mon Sep 17 00:00:00 2001 From: Juan Jose Santamaria Flecha Date: Fri, 10 Dec 2021 17:44:15 -0500 Subject: [PATCH] WIN32 pg_import_system_collations . Adds the pg_import_system_collations() functionality for Windows newer than 2008 using EnumSystemLocalesEx(). Also adding a test emulating