Re: Losing my latin on Ordering...

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: Losing my latin on Ordering...
Date: 2023-02-14 12:06:18
Message-ID: CAFCRh-8FFfaaJ9UT_3HOXpr4ZnC5eDyo=MzGLTD2474=TJG_wA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 14, 2023 at 12:35 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
wrote:

> On 2023-Feb-14, Dominique Devienne wrote:
> > Honestly, who expects the same prefix to sort differently based on what
> > comes after, in left-to-right languages?
>
Look, we don't define the collation rules.
>

Ok, ok, sorry. To you, Laurenz, and everyone.
I obviously disagree with these rules, but I'm a nobody, so who cares :)

> > So the "C" collation is fine with general UTF-8 encoding?
> > I.e. it will be codepoint ordered OK?
>
> Sure, just make sure to use the definition of C that uses UTF-8 encoding
> (I think it's typically called C.UTF-8).
>

OK, so for new DBs, sounds like we need to

CREATE DATABASE ... WITH LOCALE 'C.UTF-8' ENCODING UTF8

Correct?

But what about existing DBs? Can the collation be changed a posteriori?
ALTER DATABASE does not seem to support the same options.

We don't want to have to sprinkle COLLATE "C" all over the place in the
code.
And there are quite a few DBs out there already. What to do about them?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2023-02-14 12:27:53 Re: Losing my latin on Ordering...
Previous Message Laurenz Albe 2023-02-14 11:40:46 Re: Losing my latin on Ordering...