Re: Choosing default collation/ctype

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
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-04 20:45:16
Message-ID: bdce746ad6052774fbc0de138e7c4fcc77886e77.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2026-05-04 at 21:34 +0200, Daniel Verite wrote:
> Laurenz Albe wrote:
>
> > > Then choose UTF8.
> >
> > Right!  And I recommend "C" for the collation.
>
> Yet the "C" collation is unsuitable for handling character types
> beyond ASCII.
> For instance, it considers that accented letters are not letters,
> so upper('été') is 'éTé' instead of 'ÉTÉ', and 'é' ~ '\w' is false.
>
> C.UTF-8 solves that, and since Postgres 17, it's available for all operating
> systems with the builtin provider.
> 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.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2026-05-04 20:58:12 Re: Choosing default collation/ctype
Previous Message Matt Magoffin 2026-05-04 19:53:39 Re: Confirmation on concurrent SELECT FOR UPDATE with ON CONFLICT DO NOTHING