mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Allow tailoring of ICU locales with custom rules
This exposes the ICU facility to add custom collation rules to a standard collation. New options are added to CREATE COLLATION, CREATE DATABASE, createdb, and initdb to set the rules. Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at> Reviewed-by: Daniel Verite <daniel@manitou-mail.org> Discussion: https://www.postgresql.org/message-id/flat/821c71a4-6ef0-d366-9acf-bb8e367f739f@enterprisedb.com
This commit is contained in:
@@ -421,10 +421,19 @@ CheckMyDatabase(const char *name, bool am_superuser, bool override_allow_connect
|
||||
|
||||
if (dbform->datlocprovider == COLLPROVIDER_ICU)
|
||||
{
|
||||
char *icurules;
|
||||
|
||||
datum = SysCacheGetAttr(DATABASEOID, tup, Anum_pg_database_daticulocale, &isnull);
|
||||
Assert(!isnull);
|
||||
iculocale = TextDatumGetCString(datum);
|
||||
make_icu_collator(iculocale, &default_locale);
|
||||
|
||||
datum = SysCacheGetAttr(DATABASEOID, tup, Anum_pg_database_daticurules, &isnull);
|
||||
if (!isnull)
|
||||
icurules = TextDatumGetCString(datum);
|
||||
else
|
||||
icurules = NULL;
|
||||
|
||||
make_icu_collator(iculocale, icurules, &default_locale);
|
||||
}
|
||||
else
|
||||
iculocale = NULL;
|
||||
|
||||
Reference in New Issue
Block a user