Re: insensitive collations

Daniel Verite <daniel@manitou-mail.org>

From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Peter Eisentraut" <peter.eisentraut@2ndquadrant.com>
Cc: "pgsql-hackers" <pgsql-hackers@postgresql.org>
Date: 2019-01-16T13:20:50Z
Lists: pgsql-hackers
	Peter Eisentraut wrote:

> > On a table with pre-existing contents, the creation of a unique index
> > does not seem to detect the duplicates that are equal per the
> > collation and different binary-wise.
> 
> Fixed in the attached updated patch.

Check. I've found another issue with aggregates over distinct:
the deduplication seems to ignore the collation.

postgres=# select distinct x from test3ci;   -- OK
  x  
-----
 def
 abc
 ghi
(3 rows)

postgres=# select count(distinct x) from test3ci;  -- not OK
 count 
-------
     4
(1 row)

postgres=# select array_agg(distinct x) from test3ci;  -- not OK
     array_agg	   
-------------------
 {ABC,abc,def,ghi}
(1 row)


Best regards,
-- 
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


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