Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDSIy-0002Ly-MK for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2020 12:56:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDSIx-0004bn-38 for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2020 12:55:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDSIw-0004bf-HI for pgsql-bugs@lists.postgresql.org; Wed, 02 Sep 2020 12:55:58 +0000 Received: from mail.dalibo.com ([212.85.157.172]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDSIs-000263-RR for pgsql-bugs@lists.postgresql.org; Wed, 02 Sep 2020 12:55:57 +0000 Received: from firost (larco.ioguix.net [82.66.0.6]) by mail.dalibo.com (Postfix) with ESMTPSA id DDEA91F8B9; Wed, 2 Sep 2020 14:55:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1599051352; bh=rc4l4px81SU2PGj0B0sfXbhCGU7yUeBFLGkU3vLU3pA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Z7wbJUtxVfNclXdtbq8gtdFTSH/sE6hugHJmkgY6Sa7teR101tnGqLUSG5wn85akQ iG5W4xS686wJOpE/sU/zq0tJpLZBoND3QVOhb3CBBkehBJHUDUZXS8wl2v09kfHOlG AoqRFxX+J+lwRu6upq3ERMC/LTpC9c8zp9fT0L5o= Date: Wed, 2 Sep 2020 14:55:50 +0200 From: Jehan-Guillaume de Rorthais To: Peter Eisentraut , "Daniel Verite" Cc: Thomas Munro , Peter Geoghegan , =?UTF-8?B?0KDQvtC80LDQvSDQm9C40YLQvtCy0YfQtdC90LrQvg==?= , PostgreSQL mailing lists Subject: Re: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows Message-ID: <20200902145550.6a5014fb@firost> In-Reply-To: <4ea84116-4380-b12f-dcdf-7f2977ab2859@2ndquadrant.com> References: <153201618542.1404.3611626898935613264@wrigleys.postgresql.org> <20200610002933.6a6d482b@firost> <4ea84116-4380-b12f-dcdf-7f2977ab2859@2ndquadrant.com> Organization: Dalibo MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2 Sep 2020 14:06:18 +0200 Peter Eisentraut wrote: > On 2020-06-10 00:29, Jehan-Guillaume de Rorthais wrote: > > In the meantime, I've been working on various workarounds. The only one I > > found is to use "fr-u-kr-latn-digit-kn" instead of "fr-u-kr-latn-digit". > > Unfortunately, the two collations are not equivalent, but I believe it > > might be useful in many case. > > What precisely is broken in the ICU library? Using ucol_strcoll/ucol_strcollUTF8 with a custom collation sorting digits after latn. > All the examples so far refer to kr-latn-digit. Are all reorderings broken, > or something specifically related to latn and/or digit? I don't know. So far, I only found a couple of reports (mine included) using kr-latn-digit in different languages. And as I wrote, kr-latn-digit-kn doesn't seem affected. So all reorderings might not be broken. But I have no strong facts about this, just tests. > Are any collation customizations other than reorderings affected? I didn't poke around to try some other random customizations. The answer lies somewhere in the ICU codebase. I suppose we'll be able to answer this question as soon as the bug will be explained. However, the bug reported here are all about sorting: wrong result order and/or wrong result because of badly sorted index. Maybe Daniel has some more experience feedback with other customizations as he seems to work extensively with ICU and PostgreSQL? Regards,