Re: Losing my latin on Ordering... - Mailing list pgsql-general

From Dominique Devienne
Subject Re: Losing my latin on Ordering...
Date
Msg-id CAFCRh-8FFfaaJ9UT_3HOXpr4ZnC5eDyo=MzGLTD2474=TJG_wA@mail.gmail.com
Whole thread Raw
In response to Re: Losing my latin on Ordering...  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Losing my latin on Ordering...  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
On Tue, Feb 14, 2023 at 12:35 PM Alvaro Herrera <alvherre@alvh.no-ip.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?

pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Losing my latin on Ordering...
Next
From: Laurenz Albe
Date:
Subject: Re: Losing my latin on Ordering...