I am trying to configure a collation to sort upper case before lower case with numeric ordering. I am getting some unexpected results, so hoped to find a way to configure ICU to sort in a way that matches my expectations.
CREATE COLLATION testsort (provider = icu, locale = 'und-u-kf-upper-kn’);
These comparisons are working as I expected:
SELECT 'ID' < 'id' COLLATE testsort; -- true (upper before lower)
SELECT '45' < '123' COLLATE testsort; --true (45 before 123)
However combining them like the following resulted in an unexpected result:
SELECT 'ID123' < 'id45' COLLATE testsort; -- false, expected true
I thought that last one would be false because “ID” would come before “id”. Is there a way to configure the collation to achieve that? I’m trying to match the sorting behaviour in external application code.
Thanks for any help,
Matt