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

From Tom Lane
Subject Re: Question regarding UTF-8 data and "C" collation on definition of field of table
Date
Msg-id 2564482.1675647025@sss.pgh.pa.us
Whole thread Raw
In response to Re: Question regarding UTF-8 data and "C" collation on definition of field of table  (Dionisis Kontominas <dkontominas@gmail.com>)
List 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 by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Question regarding UTF-8 data and "C" collation on definition of field of table
Next
From: Richard Brockie
Date:
Subject: Re: Slow down dev database transactions/second for testing?