BUG #15892: URGENT: Using an ICU collation in a primary key column breaks ILIKE query

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: james(dot)inform(at)pharmapp(dot)de
Subject: BUG #15892: URGENT: Using an ICU collation in a primary key column breaks ILIKE query
Date: 2019-07-03 22:50:17
Message-ID: 15892-e5d2bea3e8a04a1b@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15892
Logged by: James Inform
Email address: james(dot)inform(at)pharmapp(dot)de
PostgreSQL version: 11.4
Operating system: Linux Mint 19 Tara / Mac OS X 10.13.6
Description:

-- This is tested under Linux Mint 19 Tara with uconv v2.1 ICU 60.2
-- and Mac OS X 10.13.6 with uconv v2.1 ICU 58.2
-- PostgreSQL Version 11.4
-- PostgreSQL was built with: ./configure '--prefix=/home/myself/pg114'
'--with-systemd' '--with-icu' '--with-libxml' '--with-libxslt' '--with-perl'
'--with-python' '--disable-rpath' '--with-extra-version= ICU'

-- STEPS to reproduce
-- First you need PostgreSQL 11.4 built with ICU support

create database testdb;

\c testdb;

-- Just create a simple table with one column
create table icutest(data text not null collate "de-x-icu" primary key);

-- Insert a record with uppercase string
insert into icutest values ('MYTEST');

-- This is not giving a match
select * from icutest where data ilike 'mytest';

-- These two queries give the exspected result
select * from icutest where lower(data) ilike 'mytest';
select * from icutest where data ilike ('mytest' collate "default");

-- If you do the same with a non primary source column, then everything
works like exspected
-- I'm not an Expert, but maybe the index behind the primary key is based on
the wrong collation

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Manuel Rigger 2019-07-03 23:06:08 Re: GROUP BY and inheritance issue
Previous Message David Rowley 2019-07-03 22:11:55 Re: GROUP BY and inheritance issue