Re: Question regarding UTF-8 data and "C" collation on definition of field of table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question regarding UTF-8 data and "C" collation on definition of field of table
Дата
Msg-id 2564482.1675647025@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question regarding UTF-8 data and "C" collation on definition of field of table  (Dionisis Kontominas <dkontominas@gmail.com>)
Список pgsql-general
Dionisis Kontominas <dkontominas@gmail.com> writes:
>    1.  Regarding the different languages in the same column, that is normal
>    if the column is a UTF-8 one, i.e. should be able to hold for example
>    English, Greek and Chinese characters. In this case what is the best
>    approach to define the collation and lctype of the column? Either C
>    or ucs_basic maybe or something else or it does not matter, the characters
>    would be stored correctly as long as the database is UTF8 encoding?

The characters will be stored correctly, yes.  Collation only affects
sort order.  Ctype affects some other functions like upper/lowercase
folding and what is considered a "letter" in regexps.  If you use "C"
for lc_ctype then only ASCII letters will be folded or recognized as
letters.

>    2. Is there a real difference between C and ucs_basic collation/lctype?

No, at least not in Postgres.

            regards, tom lane



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Question regarding UTF-8 data and "C" collation on definition of field of table
Следующее
От: Richard Brockie
Дата:
Сообщение: Re: Slow down dev database transactions/second for testing?