AW: PostgreSQL 10 initdb with locale de-x-icu fails on Windows Server 2012

From: "ROSESOFT S(dot) Hoffmann" <sh(at)rosesoft(dot)de>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: AW: PostgreSQL 10 initdb with locale de-x-icu fails on Windows Server 2012
Date: 2022-07-05 13:29:10
Message-ID: a2505775e6034bd4be8d4f50f0455a26@rosesoft.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello Thomas,

> Windows 10 built in ICU support
I thought all ICU stuff was built in PostgreSQL binaries and DLLs, but your explanation seems to be the cause of this problem.

> ancient Windows
This sounds like using default-collation "de" for initdb and createdb has the same effect as "de-x-icu" with PostgreSQL 10 up to 14?
Should we then use default-collation "de" instead of "de-x-icu" or "German_Germany.1252" or could this cause problems later when upgrading to PostgreSQL 15 or 16 and using "de-x-icu" as default-collation?

Regards, Stefan.

-----Ursprüngliche Nachricht-----
Von: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Gesendet: Dienstag, 5. Juli 2022 10:19
An: ROSESOFT S. Hoffmann <sh(at)rosesoft(dot)de>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>; pgsql-bugs(at)lists(dot)postgresql(dot)org
Betreff: Re: PostgreSQL 10 initdb with locale de-x-icu fails on Windows Server 2012

On Tue, Jul 5, 2022 at 7:22 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> On Mon, Jul 4, 2022 at 11:53 PM ROSESOFT S. Hoffmann <sh(at)rosesoft(dot)de> wrote:
> > On Windows Server 2016/2019/2022 and Windows 10/11 the ICU-Options work as expected!
> > Why does the problem only occurs on Windows Server 2012?
>
> Windows 10 and later contain a copy of ICU inside them. That's why
> strings like "de", "de-CH" etc work there: PostgreSQL is using the
> normal Windows collation API (it's a bit weird that we call it "libc"
> mode, when it's not exactly libc, but what we mean by that is the OS's
> native collations...). So I think it is probably Windows' internal
> copy of ICU that receives that name "de-..." and ignores the trailing
> part that it doesn't understand.

Oh, it might also be that ancient Windows can also understand "de-DE"
or "de" too, but not "de-x-icu"? That "de-x-icu" name is an internal PostgreSQL convention for collation identifiers and shouldn't be passed to initdb. If that's the case it might just be that the ICU-based versions of Windows are more tolerant, and interpret "de-x-icu" as "de", ignoring the rest, but the ancient versions reject it?

(I have no access to old Windows, I just read that even Vista could understand de-DE type names, formally known as BCP47, in some contexts... it just wasn't using ICU yet).

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-07-05 17:07:48 Re: pg_upgrade (12->14) fails on aggregate
Previous Message Alvaro Herrera 2022-07-05 12:39:32 Re: Using PQexecQuery in pipeline mode produces unexpected Close messages