projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d4a183
)
Prohibit creating ICU collation with different ctype
author
Peter Eisentraut
<peter_e@gmx.net>
Fri, 30 Jun 2017 15:24:00 +0000
(11:24 -0400)
committer
Peter Eisentraut
<peter_e@gmx.net>
Fri, 30 Jun 2017 15:24:00 +0000
(11:24 -0400)
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.
src/backend/utils/adt/pg_locale.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/utils/adt/pg_locale.c
b/src/backend/utils/adt/pg_locale.c
index 0f5ec954c3a9b58c018fd83beeb1b362cff264bb..eae9fcb0def66a28ec19d4419c88068d2293e6e5 100644
(file)
--- 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))