Re: ICU for global collation

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ICU for global collation
Date: 2022-01-11 11:18:58
Message-ID: 34c910bf-50bf-c33f-940d-3e5fe029347e@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10.01.22 12:49, Daniel Verite wrote:
> With the current patch, it's not possible, AFAICS, because the user
> can't tell that the collation is non-deterministic. Presumably this
> would require another option to CREATE DATABASE and another
> column to store that bit of information.

Adding this would be easy, but since pattern matching currently does not
support nondeterministic collations, if you make a global collation
nondeterministic, a lot of system views, psql, pg_dump queries etc.
would break, so it's not practical. I view this is an orthogonal
project. Once we can support this without breaking system views etc.,
then it's easy to enable with a new column in pg_database.

> The "daticucol" column also suggests that we don't expect to add
> other collation providers in the future. Maybe a pair of columns like
> (datcollprovider, datcolllocale) would be more future-proof,
> or a (datcollprovider, datcolllocale, datcollisdeterministic)
> triplet if non-deterministic collations are allowed.

I don't expect many new collation providers. So I don't think an
EAV-like storage would be helpful. The other problem is that we don't
know what we need. For example, the libc provider needs both a collate
and a ctype value, so that wouldn't fit into that scheme nicely.

> Also, pg_collation has "collversion" to detect a mismatch between
> the ICU runtime and existing indexes. I don't see that field
> for the db-wide ICU collation, so maybe we currently miss the capability
> to detect the mismatch for the db-wide collation?

Yeah, I think I need to add a datcollversion field and the associated
checks.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message RKN Sai Krishna 2022-01-11 11:18:59 Query regarding replication slots
Previous Message Peter Eisentraut 2022-01-11 11:10:14 Re: ICU for global collation