Turn sql logging on (either in the db pool config, or by turning debug on) and see what it is actually comparing on. All I saw was "order by sort_key" which should be case sensitive:
bf2=# select 'a' as a union select 'A' as a union select 'Z' as a order by a;
a
---
A
Z
a