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

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

On Thu, Jun 5, 2025 at 4:52 AM Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> > On Windows, I'm getting
> I tried on windows and linux and got the same result.

Thanks Jeff, for your informative email. The command work,
just like it does on Linux. YET... The results are NOT the same!

C:\Users\ddevienne>psql service=my17
psql (17.4, server 17.5)

ddevienne=> select version();
version
-------------------------------------------------------------------------
PostgreSQL 17.5 on x86_64-windows, compiled by msvc-19.43.34808, 64-bit
(1 row)

ddevienne=> create database "dd_v168" encoding 'UTF8' locale 'C.UTF-8'
ddevienne-> locale_provider 'builtin' template template0;
ERROR: invalid LC_COLLATE locale name: "C.UTF-8"
HINT: If the locale name is specific to ICU, use ICU_LOCALE.

ddevienne=> create database "dd_v168" encoding 'UTF8' builtin_locale 'C.UTF-8'
ddevienne-> locale_provider 'builtin' template template0;
CREATE DATABASE
ddevienne=> select datlocprovider, datlocale, datcollate, datctype
from pg_database where datname = 'dd_v168';
datlocprovider | datlocale | datcollate | datctype
----------------+-----------+------------+----------
b | C.UTF-8 | C | C
(1 row)

Contrast that with the results on Linux, I just sent in response to
Laurenz's message, and that I'll repeat below:

ddevienne=> select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 17.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0
20210514 (Red Hat 8.5.0-26), 64-bit
(1 row)
ddevienne=> create database "dd_v168b" encoding 'UTF8' builtin_locale 'C.UTF-8'
ddevienne-> locale_provider 'builtin' template template0;
CREATE DATABASE
ddevienne=> select datlocprovider, datlocale, datcollate, datctype
from pg_database where datname = 'dd_v168b';
datlocprovider | datlocale | datcollate | datctype
----------------+-----------+-------------+-------------
b | C.UTF-8 | en_US.UTF-8 | en_US.UTF-8
(1 row)

Which means the same commands sometimes work, sometimes not, across platforms.
But when they work, they don't even yield the SAME results. Which
means it's not portable IMHO...

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dominique Devienne 2025-06-05 09:34:48 Re: LOCALE C.UTF-8 on EDB Windows v17 server
Previous Message Francisco Olarte 2025-06-05 08:54:05 Re: Feature request: Settings to disable comments and multiple statements in a connection