Re: Choosing default collation/ctype

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Laurenz Albe" <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Choosing default collation/ctype
Date: 2026-05-05 11:16:14
Message-ID: f7b3c538-8e78-47f4-82f1-2e54e8da2f0b@manitou-mail.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Laurenz Albe wrote:

> > So if you target Postgres 17+, C.UTF-8 from the builtin provider is
> > a better choice for UTF-8 databases than "C" .
>
> Yes, "builtin" and the "C" collation is the best default value.

But my point was that, no, it's not.
Let's show a concrete example with Postgres 18:

postgres=# create database dbc
template='template0'
locale_provider='builtin'
builtin_locale='C' ;
CREATE DATABASE

postgres=# \c dbc
You are now connected to database "dbc" as user "postgres".

dbc=# select upper('été');
upper
-------
éTé
(1 row)

It is not the correct uppercasing. On the other hand the "C.UTF-8"
locale, as opposed to "C", produces the correct result.

postgres=# create database dbcutf8
template='template0'
locale_provider='builtin'
builtin_locale='C.UTF-8' ;
CREATE DATABASE

postgres=# \c dbcutf8
You are now connected to database "dbcutf8" as user "postgres".

dbcutf8=# select upper('été');
upper
-------
ÉTÉ
(1 row)

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2026-05-05 11:31:00 Re: Choosing default collation/ctype
Previous Message Daniel Gustafsson 2026-05-05 08:49:28 Re: ODBC SSL connection issue on Solaris with PostgreSQL 18 (OpenSSL 1.0.2)