pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
AW: PostgreSQL 10 initdb with locale de-x-icu fails on Windows Server 2012
2+ messages / 1 participants
[nested] [flat]

* AW: PostgreSQL 10 initdb with locale de-x-icu fails on Windows Server 2012
@ 2022-07-04 11:53  ROSESOFT S. Hoffmann <sh@rosesoft.de>
  0 siblings, 1 reply; 2+ messages in thread

From: ROSESOFT S. Hoffmann @ 2022-07-04 11:53 UTC (permalink / raw)
  To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Hello Kyotaro Horiguchi,

i still think this a bug, because "createdb" also can't use any ICU-collations (same error message).

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?

An Upgrade to PostgreSQL 15 is not an option, now.

Best Regards,
Stefan.

-----Ursprüngliche Nachricht-----
Von: Kyotaro Horiguchi <horikyota.ntt@gmail.com> 
Gesendet: Montag, 4. Juli 2022 02:34
An: ROSESOFT S. Hoffmann <sh@rosesoft.de>
Cc: pgsql-bugs@lists.postgresql.org
Betreff: Re: PostgreSQL 10 initdb with locale de-x-icu fails on Windows Server 2012

At Fri, 1 Jul 2022 13:07:13 +0000, "ROSESOFT S. Hoffmann" <sh@rosesoft.de> wrote in 
> initdb.exe .. -E UTF8 --locale=de-x-icu --text-search-config=german ..
> 
> Error message:
> initdb: ungültiger Locale-Name »de-x-icu«

> According to https://www.postgresql.org/download/windows/ PostgreSQL
> 10 is supported by Windows Server 2012.

If you are unfortunately using PostgreSQL 10, it doesn't support ICU collations as the default for databases.  It's a new feature of 15.

https://www.postgresql.org/docs/15/release-15.html
> - Allow ICU collations to be set as the default for clusters and
>   databases (Peter Eisentraut)
>   Previously, ICU collations could only be specified in CREATE
>   COLLATION and used with the COLLATE clause.

If you are using PG15, --icu-locale accompanied by --locale-provider=icu instead of --locale will work for you.

https://www.postgresql.org/docs/devel/app-initdb.html

> Alternatively, the ICU library can be used to provide locale services. 
> (Again, this only sets the default for subsequently created
> databases.) To select this option, specify --locale-provider=icu. To 
> choose the specific ICU locale ID to apply, use the option 
> --icu-locale. Note that for implementation reasons and to support 
> legacy code, initdb will still select and initialize libc locale 
> settings when the ICU locale provider is used.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* AW: PostgreSQL 10 initdb with locale de-x-icu fails on Windows Server 2012
@ 2022-07-05 13:29  ROSESOFT S. Hoffmann <sh@rosesoft.de>
  parent: ROSESOFT S. Hoffmann <sh@rosesoft.de>
  0 siblings, 0 replies; 2+ messages in thread

From: ROSESOFT S. Hoffmann @ 2022-07-05 13:29 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

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.munro@gmail.com> 
Gesendet: Dienstag, 5. Juli 2022 10:19
An: ROSESOFT S. Hoffmann <sh@rosesoft.de>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>; pgsql-bugs@lists.postgresql.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.munro@gmail.com> wrote:
> On Mon, Jul 4, 2022 at 11:53 PM ROSESOFT S. Hoffmann <sh@rosesoft.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).


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-07-05 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 11:53 AW: PostgreSQL 10 initdb with locale de-x-icu fails on Windows Server 2012 ROSESOFT S. Hoffmann <sh@rosesoft.de>
2022-07-05 13:29 ` ROSESOFT S. Hoffmann <sh@rosesoft.de>

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