Re: Order changes in PG16 since ICU introduction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Regina Obe" <lr(at)pcorp(dot)us>
Cc: "'Peter Eisentraut'" <peter(dot)eisentraut(at)enterprisedb(dot)com>, "'Sandro Santilli'" <strk(at)kbt(dot)io>, pgsql-hackers(at)lists(dot)postgresql(dot)org, "'Jeff Davis'" <pgsql(at)j-davis(dot)com>
Subject: Re: Order changes in PG16 since ICU introduction
Date: 2023-04-21 18:23:45
Message-ID: 3372735.1682101425@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Regina Obe" <lr(at)pcorp(dot)us> writes:
> CREATE DATABASE test1 TEMPLATE=template0 ENCODING = 'UTF8' LOCALE = 'C';
> Doesn't seem to work at least not under mingw64 anyway.

Hmm, doesn't work for me either:

$ LANG=en_US.utf8 initdb
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

Using default ICU locale "en_US".
Using language tag "en-US" for ICU locale "en_US".
The database cluster will be initialized with this locale configuration:
provider: icu
ICU locale: en-US
LC_COLLATE: en_US.utf8
LC_CTYPE: en_US.utf8
LC_MESSAGES: en_US.utf8
LC_MONETARY: en_US.utf8
LC_NUMERIC: en_US.utf8
LC_TIME: en_US.utf8
...
$ psql postgres
psql (16devel)
Type "help" for help.

postgres=# SELECT '+' < '-' ;
?column?
----------
f
(1 row)

(as expected, so far)

postgres=# CREATE DATABASE test1 TEMPLATE=template0 ENCODING = 'UTF8' LOCALE = 'C';
CREATE DATABASE
postgres=# \c test1
You are now connected to database "test1" as user "postgres".
test1=# SELECT '+' < '-' ;
?column?
----------
f
(1 row)

(wrong!)

test1=# \l
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+------------+------------+------------+-----------+-----------------------
postgres | postgres | UTF8 | icu | en_US.utf8 | en_US.utf8 | en-US | |
template0 | postgres | UTF8 | icu | en_US.utf8 | en_US.utf8 | en-US | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | icu | en_US.utf8 | en_US.utf8 | en-US | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
test1 | postgres | UTF8 | icu | C | C | en-US | |
(4 rows)

Looks like the "pick en-US even when told not to" problem exists here too.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sandro Santilli 2023-04-21 19:14:13 Re: Order changes in PG16 since ICU introduction
Previous Message Regina Obe 2023-04-21 18:13:49 RE: Order changes in PG16 since ICU introduction