mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Prohibit creating ICU collation with different ctype
ICU does not support "collate" and "ctype" being different, so the collctype catalog column is ignored. But for catalog neatness, ensure that they are the same.
This commit is contained in:
@ -1354,6 +1354,11 @@ pg_newlocale_from_collation(Oid collid)
|
||||
UCollator *collator;
|
||||
UErrorCode status;
|
||||
|
||||
if (strcmp(collcollate, collctype) != 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("collations with different collate and ctype values are not supported by ICU")));
|
||||
|
||||
status = U_ZERO_ERROR;
|
||||
collator = ucol_open(collcollate, &status);
|
||||
if (U_FAILURE(status))
|
||||
|
Reference in New Issue
Block a user