Re: LOCALE C.UTF-8 on EDB Windows v17 server

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: LOCALE C.UTF-8 on EDB Windows v17 server
Date: 2025-06-05 21:11:43
Message-ID: f794e177b0b1ed8917e75258726ae315cf8fbbef.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2025-06-05 at 11:34 +0200, Dominique Devienne wrote:
> On Thu, Jun 5, 2025 at 11:07 AM Dominique Devienne
> <ddevienne(at)gmail(dot)com> wrote:
> > So... It is possible to have the SAME command on Windows and Linux,
> > which yields the SAME datcollate and datctype values???
> > So far, such a command eludes me, I'm afraid. --DD
>
> So I tried to be explicit about lc_collate and lc_ctype too.
> OK on Linux, KO on Windows...

LC_COLLATE and LC_CTYPE (datcollate and datctype) are platform-
dependent (handled by libc) so it won't be possible for those to have
the same meaning across different systems. The only locale that's
guaranteed to be available, AFAIK, is "C". Even some other unix-like
operating systems don't support "C.UTF-8".

The good news is that LC_COLLATE and LC_CTYPE don't have much effect if
you are using a different provider like "builtin" or ICU. They affect
the server's LC_COLLATE and LC_CTYPE environment, which does have a few
effects, but in general we are trying to avoid cases where those matter
a lot.

To maintain consistency across platforms, use LC_COLLATE=C and
LC_CTYPE=C when creating a database; along with the builtin provider
and UTF-8 as you are already doing.

Regards,
Jeff Davis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2025-06-05 21:53:20 Re: LOCALE C.UTF-8 on EDB Windows v17 server
Previous Message Daniel Verite 2025-06-05 20:57:24 Re: LOCALE C.UTF-8 on EDB Windows v17 server