Peter Eisentraut <pete...@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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to