From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dionisis Kontominas <dkontominas@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Question regarding UTF-8 data and "C" collation on definition of field of table
Date: Sun, 05 Feb 2023 20:30:25 -0500
Message-ID: <2564482.1675647025@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB4Evu1mV53U1K-5jGxRq-u2GchP3kq3R97O11CRvQhGXfJuew@mail.gmail.com>
References: <CAB4Evu1nV57hohRkEzs3J5MtDOzLFo-Uo-_TtLbiUB1WEFVOxw@mail.gmail.com>
<2550995.1675639480@sss.pgh.pa.us>
<CAB4Evu30cbKTZrYFh=zf-+TizKtQe28hFcdJpMw5wrEex7++fQ@mail.gmail.com>
<2556580.1675642741@sss.pgh.pa.us>
<CAB4Evu1mV53U1K-5jGxRq-u2GchP3kq3R97O11CRvQhGXfJuew@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, dkontominas@gmail.com
Subject: Re: Question regarding UTF-8 data and "C" collation on definition of field of table
In-Reply-To: <2564482.1675647025@sss.pgh.pa.us>
References: <CAB4Evu1nV57hohRkEzs3J5MtDOzLFo-Uo-_TtLbiUB1WEFVOxw@mail.gmail.com> <2550995.1675639480@sss.pgh.pa.us> <CAB4Evu30cbKTZrYFh=zf-+TizKtQe28hFcdJpMw5wrEex7++fQ@mail.gmail.com> <2556580.1675642741@sss.pgh.pa.us> <CAB4Evu1mV53U1K-5jGxRq-u2GchP3kq3R97O11CRvQhGXfJuew@mail.gmail.com> <2564482.1675647025@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox