On Tue, 2023-02-14 at 13:06 +0100, Dominique Devienne wrote: > > 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? Collations are identifiers, so it has to be double quotes. The name depends on the operating system; if that is Unix-like, you can run "locale -a" to get all available locales. On my system it would be CREATE DATABASE x TEMPLATE template0 LOCALE "C.utf8" ENCODING UTF8; > 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? The only option is dump/restore. A changed collation means changed indexes, so there is no better option. Yours, Laurenz Albe