PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15285
PG Version10.4
OSfedora
Opened2018-07-19 16:03:05+00
Reported byRoman Lytovchenko
StatusOpen

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15285
Logged by:          Roman Lytovchenko
Email address:      (redacted)
PostgreSQL version: 10.4
Operating system:   fedora
Description:        

How to reproduce:
CREATE COLLATION digitslast (provider = icu, locale =
'en@colReorder=latn-digit');
CREATE TABLE t (b CHAR(4) NOT NULL COLLATE digitslast);
insert into t select '0000' from generate_series (0, 1000) as f(x);
insert into t select '0001' from generate_series (0, 1000) as f(x);
insert into t select 'ABCD' from generate_series (0, 1000) as f(x);

create index i on t(b);
select * from t where b = '0000' ;
-- 0 rows, and this is a bug

explain analyze select * from t where b = '0000' ;
Index Only Scan using i on t  (cost=0.28..41.80 rows=1001 width=5) (actual
time=0.045..0.045 rows=0 loops=1)
  Index Cond: (b = '0000'::bpchar)
  Heap Fetches: 0
Planning time: 0.146 ms
Execution time: 0.080 ms

drop index i;
select * from t where b = '0000' ;
-- 1001 rows

So, select version();
PostgreSQL 10.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.0.1 20180324
(Red Hat 8.0.1-0.20), 64-bit
$cat /proc/version 
Linux version 3.10.0-514.10.2.el7.x86_64 (builder@kbuilder.dev.centos.org)
(gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Fri Mar 3
00:04:05 UTC 2017

Messages

DateAuthorSubject
2018-07-19 16:03:05+00=?utf-8?q?PG_Bug_reporting_form?=BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows
2018-07-19 16:44:32+00Peter GeogheganRe: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows
2018-07-19 23:26:49+00Peter GeogheganRe: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows
2018-07-21 01:39:12+00Thomas MunroRe: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows
2020-06-09 22:29:33+00Jehan-Guillaume de RorthaisRe: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows
2020-06-12 16:40:55+00Jehan-Guillaume de RorthaisRe: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows
2020-06-12 22:43:22+00Jehan-Guillaume de RorthaisRe: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows