Re: insensitive collations

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Daniel Verite <daniel@manitou-mail.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-02-21T17:11:27Z
Lists: pgsql-hackers

Attachments

On 2019-02-21 09:36, Peter Eisentraut wrote:
>> * Why have you disable this optimization?:
>>
>>>     /* Fast pre-check for equality, as discussed in varstr_cmp() */
>>> -   if (len1 == len2 && memcmp(a1p, a2p, len1) == 0)
>>> +   if ((!sss->locale || sss->locale->deterministic) &&
>>> +       len1 == len2 && memcmp(a1p, a2p, len1) == 0)
>> I don't see why this is necessary. A non-deterministic collation
>> cannot indicate that bitwise identical strings are non-equal.
> Right, I went too far there.
> 
>> * Perhaps you should add a "Tip" referencing the feature to the
>> contrib/citext documentation.
> Good idea.

Here is another patch that fixes these two points.

I have also worked on the tests hoping to appease the cfbot.

Older ICU versions (<54) don't support all the locale customization
options, so many of my new tests in collate.icu.utf8.sql will fail on
older systems.  What should we do about that?  Have another extra test file?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Commits

  1. Collations with nondeterministic comparison

  2. Add support for collation attributes on older ICU versions

  3. Make type "name" collation-aware.

  4. Make collation-aware system catalog columns use "C" collation.

  5. Adjust string comparison so that only bitwise-equal strings are considered