On Thu, Jun 5, 2025 at 4:52 AM Jeff Davis <pgsql@j-davis.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