On Fri, Jun 2, 2017 at 9:27 AM, Peter Geoghegan <pg@bowt.ie> wrote:
> On Thu, Jun 1, 2017 at 2:24 PM, Thomas Munro
> <thomas.munro@enterprisedb.com> wrote:
>> Why should ICU be any different than the system provider in this
>> respect? In both cases, we have a two-level comparison: first we use
>> the collation-aware comparison, and then as a tie breaker, we use a
>> binary comparison. If we didn't do a binary comparison as a
>> tie-breaker, wouldn't the result be logically incompatible with the =
>> operator, which does a binary comparison?
>
> I agree with that assessment.
I think you *could* make a logically consistent set of operations with
no binary tie-breaker. = could be defined in terms of strcoll and
hash could hash the output of strxfrm, but it it'd be impractical and
slow. In order to take advantage of simple and fast = and hash, we go
the other way and teach < and > about binary order.
--
Thomas Munro
http://www.enterprisedb.com