Re: WIN32 pg_import_system_collations

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>, Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: WIN32 pg_import_system_collations
Date: 2022-01-25 10:40:45
Message-ID: 639e0abd-ea82-b751-bfba-5166a7a1b304@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 function
>
> GetNLSVersionEx(COMPARE_STRING, wide_collcollate, &version)
>
> (see win32_read_locale() -> CollationFromLocale() -> CollationCreate()
> call). Is it correct to use (wide_collcollate = "en_NZ") instead of
> (wide_collcollate = "en-NZ") in GetNLSVersionEx() function?

I don't really know if this is necessary anyway. Just create the
collations with the names that the operating system presents. There is
no requirement to make the names match POSIX.

If you want to make them match POSIX for some reason, you can also just
change the object name but leave the collcollate/collctype fields the
way they came from the OS.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-01-25 10:47:14 Re: GUC flags
Previous Message Peter Eisentraut 2022-01-25 10:34:17 Re: Non-decimal integer literals