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:
Peter Eisentraut 2017-06-30 11:24:00 -04:00
parent 7d4a1838ef
commit 13a57710db

View File

@ -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))