On Thu, 2025-06-05 at 11:34 +0200, Dominique Devienne wrote:
> On Thu, Jun 5, 2025 at 11:07 AM Dominique Devienne
> <ddevienne@gmail.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