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 19:19:01 -0500
Message-ID: <2556580.1675642741@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB4Evu30cbKTZrYFh=zf-+TizKtQe28hFcdJpMw5wrEex7++fQ@mail.gmail.com>
References: <CAB4Evu1nV57hohRkEzs3J5MtDOzLFo-Uo-_TtLbiUB1WEFVOxw@mail.gmail.com>
<2550995.1675639480@sss.pgh.pa.us>
<CAB4Evu30cbKTZrYFh=zf-+TizKtQe28hFcdJpMw5wrEex7++fQ@mail.gmail.com>
Dionisis Kontominas <dkontominas@gmail.com> writes:
> I suppose that affects the outcome of ORDER BY clauses on the field,
> along with the content of the indexes. Is this right?
Yeah.
> Assuming that the requirement exists, to store UTF-8 characters on a
> field that can be from multiple languages, and the database default
> encoding is UTF8 which is the right thing I suppose (please verify), what
> do you think should be the values of the Collation and Ctype for the
> database to behave correctly?
Um ... so define "correct". If you have a mishmash of languages in the
same column, it's likely that they have conflicting rules about sorting,
and there may be no ordering that's not surprising to somebody.
If there's a predominant language in the data, selecting a collation
matching that seems like your best bet. Otherwise, maybe you should
just shrug your shoulders and stick with C collation. It's likely
to be faster than any alternative.
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: <2556580.1675642741@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>
* 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