pgsql: Add support for collation attributes on older ICU versions

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add support for collation attributes on older ICU versions
Date: 2019-03-17 07:47:45
Message-ID: E1h5QWH-0004aV-Ua@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add support for collation attributes on older ICU versions

Starting in ICU 54, collation customization attributes can be
specified in the locale string, for example
"@colStrength=primary;colCaseLevel=yes". Add support for this for
older ICU versions as well, by adding some minimal parsing of the
attributes in the locale string and calling ucol_setAttribute() on
them. This is essentially what never ICU versions do internally in
ucol_open(). This was we can offer this functionality in a consistent
way in all ICU versions supported by PostgreSQL.

Also add some tests for ICU collation customization.

Reported-by: Daniel Verite <daniel(at)manitou-mail(dot)org>
Discussion: https://www.postgresql.org/message-id/0270ebd4-f67c-8774-1a5a-91adfb9bb41f@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b8f9a2a69a279d118e366a0d3d45caa84a7620b1

Modified Files
--------------
src/backend/utils/adt/pg_locale.c | 104 +++++++++++++++++++++++++
src/test/regress/expected/collate.icu.utf8.out | 39 ++++++++++
src/test/regress/sql/collate.icu.utf8.sql | 21 +++++
3 files changed, 164 insertions(+)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2019-03-17 07:56:44 pgsql: Fix make rules for jsonpath grammar making them similar to SQL g
Previous Message Alexander Korotkov 2019-03-17 07:12:29 pgsql: Fix compiler warning in jsonpath_exec.c