diff options
author | Peter Eisentraut | 2017-06-30 15:24:00 +0000 |
---|---|---|
committer | Peter Eisentraut | 2017-06-30 15:24:00 +0000 |
commit | 13a57710dbafad26669833add0ae6ae60314f8dc (patch) | |
tree | 8a67ba2e41046c27458ae557f3e0a0eb0655b203 | |
parent | 7d4a1838efc5a93ba96b8e0e77f39731603a1f48 (diff) |
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.
-rw-r--r-- | src/backend/utils/adt/pg_locale.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index 0f5ec954c3..eae9fcb0de 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -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)) |