Peter Eisentraut <peter_e@gmx.net> writes:
> Well, the comparison function varstr_cmp() contains this comment:
> /*
> * In some locales strcoll() can claim that nonidentical strings are
> * equal. Believing that would be bad news for a number of reasons,
> * so we follow Perl's lead and sort "equal" strings according to
> * strcmp().
> */
> This might not be strictly necessary, seeing that citext obviously
> doesn't work that way, but resolving this is really an orthogonal issue.
The problem with not doing that is it breaks hashing --- hash joins and
hash aggregation being the real pain points.
citext works around this in a rather klugy fashion by decreeing that two
strings are equal iff their str_tolower() conversions are bitwise equal.
So it can hash the str_tolower() representation. But that's kinda slow
and it fails in the general case anyhow, I think.
regards, tom lane