Re: create a database with encoding LATIN1

Поиск
Список
Период
Сортировка
От Grzegorz Szpetkowski
Тема Re: create a database with encoding LATIN1
Дата
Msg-id BANLkTikVOZSgLSx17x2EfS0_PyEbRhnB4g@mail.gmail.com
обсуждение исходный текст
Ответ на create a database with encoding LATIN1  (Didier Gasser-Morlay <didiergm@gmail.com>)
Ответы Re: create a database with encoding LATIN1  (Sébastien D'Errico <sebastien@hollox.net>)
Список pgsql-novice
2011/5/3 Didier Gasser-Morlay <didiergm@gmail.com>:
> This is how I do it: when you setup your db cluster, chose the locale 'C'
> this will let you select LATIN1 as a database encoding. (or as fas as I
> understand, any other encoding)
> If you let it at the default value, the cluster lc is defaulted to the
> serveur local charset, in your case UTF8 - English_Canada.1252 (as would any
> modern windows/linux server be nowadays)
> Hope this helps
> Didier

That's good point. You can use C/POSIX locale with LATIN1 or any other
encoding, but in such case you lost some (probably useful) text
functionalities, which are provided by specific locale (upper, lower,
and initcap functions bahaviour, sort order using ORDER BY etc.).

"For C or POSIX locale, any character set is allowed, but for other
locales there is only one character set that will work correctly. (On
Windows, however, UTF-8 encoding can be used with any locale.)"

"If you want the system to behave as if it had no locale support, use
the special locale C or POSIX."

"The drawback of using locales other than C or POSIX in PostgreSQL is
its performance impact. It slows character handling and prevents
ordinary indexes from being used by LIKE. For this reason use locales
only if you actually need them."

Regards,
Grzegorz Szpetkowski

В списке pgsql-novice по дате отправления:

Предыдущее
От: Didier Gasser-Morlay
Дата:
Сообщение: create a database with encoding LATIN1
Следующее
От: "Mark Johnson"
Дата:
Сообщение: Re: [ADMIN] Can we Flush the Postgres Shared Memory ?