Re: WIN32 pg_import_system_collations - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: WIN32 pg_import_system_collations
Date
Msg-id 9f1c24f0-9340-8044-94e7-5f5389a53d08@enterprisedb.com
Whole thread Raw
In response to Re: WIN32 pg_import_system_collations  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Responses Re: WIN32 pg_import_system_collations
List pgsql-hackers
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 the thread for the commit message, I think that maybe the 
> collation naming remarks were not properly addressed. In the current 
> version the collations retain their native name, but an alias is created 
> for those with a shape that we can assume a POSIX equivalent exists.

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 else should 
also look it over.

A small style issue: Change return (TRUE) to return TRUE.

The code

+   if (strlen(localebuf) == 5 && localebuf[2] == '-')

might be too specific.  At least on some POSIX systems, I have seen 
locales with a three-letter language name.  Maybe you should look with 
strchr() and not be too strict about the exact position.

For the test patch, why is a separate test for non-UTF8 needed on 
Windows.  Does the UTF8 one not work?

+       version() !~ 'Visual C\+\+'

This probably won't work for MinGW.




pgsql-hackers by date:

Previous
From: Ronan Dunklau
Date:
Subject: Re: Add proper planner support for ORDER BY / DISTINCT aggregates
Next
From: Andres Freund
Date:
Subject: Re: Improve logging when using Huge Pages