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 1kDl3l-0006gL-RR for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Sep 2020 08:57:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDl3k-00026r-O7 for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Sep 2020 08:57:32 +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 1kDl3k-00026j-AF for pgsql-bugs@lists.postgresql.org; Thu, 03 Sep 2020 08:57:32 +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 1kDl3i-0004kl-7i for pgsql-bugs@lists.postgresql.org; Thu, 03 Sep 2020 08:57:31 +0000 Received: from firost (larco.ioguix.net [82.66.0.6]) by mail.dalibo.com (Postfix) with ESMTPSA id 7830920460; Thu, 3 Sep 2020 10:57:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1599123448; bh=107kmjcSFEGxTFLDWKBqA8qS2t77Sn/USSZaflpoueE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=D3rXn2WyXJ31MQxOVLi38v8gG2hIHzDK1yXDMXBm2pfgGmFgXaanFiaDeKX/f2pEr KmxvQ6MeqYGha0a9M0Vb6oRIvOJmhGYec9WvJXh7ZQGeyTeB1CTvbktdc5Zca9zaFk Wcix1QDF/eeYrLpnOUE1l9zJMQikDq8EneCLSuyA= Date: Thu, 3 Sep 2020 10:57:27 +0200 From: Jehan-Guillaume de Rorthais To: Peter Eisentraut Cc: Daniel Verite , 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: <20200903105727.064665ce@firost> In-Reply-To: <0df88ec9-90c6-54cb-ca63-7aafa5903b0c@2ndquadrant.com> References: <8b6f61c4-eb21-484c-bdc6-e4b8e9f3ee62@manitou-mail.org> <0df88ec9-90c6-54cb-ca63-7aafa5903b0c@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 Thu, 3 Sep 2020 10:26:03 +0200 Peter Eisentraut wrote: > On 2020-09-03 09:41, Daniel Verite wrote: > > Jehan-Guillaume de Rorthais wrote: > > > >> Maybe Daniel has some more experience feedback with other customizations > > > > No, I've just tried various other reorderings, and didn't find any other > > that seems to have the same bug as latn-digit. > > My tests consisted of indexing a large corpus of text and running the > > index through amcheck. > > In this case I'm tempted to just leave it alone and write it off as a > bug in ICU. We could potentially inspect the collator object at CREATE > COLLATION time and issues warnings if we find something we know to be buggy. > > I don't think we want to make our code uglier and slower It's not that uglier, only slower. And maybe we could wrap the logic inside some dedicated func/macro checking for versions, etc. > for normal uses to work around a bug in some niche feature in ICU. Well, indeed, I was wondering in another thread if we should fix it or document it. However, raising some WARNING doesn't seem enough as we would effectively leave the user create a buggy collation and maybe corrupted index on top of it. *If* we choose this way, I would vote for an ERROR. However, as I wrote earlier, we have no hard evidence latn-digit is the only buggy customization with ICU. Even if there is very little probability, we might have to pile up some more tests about versions, customization, etc. As instance, we would have to exclude latn-digit, but not latn-digit-kn, for some ICU versions, etc, etc... until proven otherwise. Code maintenance for each new version of ICU might become boring. But maybe I am being silly while planing on some unknown things and ICU is only affected for latn-digit? I really have no strong feeling right now about the best solution to adopt. However, I feel the least to do would be document it somewhere with a lot of strong emphasis. Regards,