Re: Losing my latin on Ordering...
От | Laurenz Albe |
---|---|
Тема | Re: Losing my latin on Ordering... |
Дата | |
Msg-id | 8b429ae28697738330e13504d056c0a9a178e32c.camel@cybertec.at обсуждение исходный текст |
Ответ на | Re: Losing my latin on Ordering... (Dominique Devienne <ddevienne@gmail.com>) |
Список | pgsql-general |
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
В списке pgsql-general по дате отправления: