Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wOwVu-000Igz-2w for pgsql-hackers@arkaria.postgresql.org; Mon, 18 May 2026 11:52:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wOwVs-0023a9-1y for pgsql-hackers@arkaria.postgresql.org; Mon, 18 May 2026 11:52:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wOwVs-0023a0-0S for pgsql-hackers@lists.postgresql.org; Mon, 18 May 2026 11:52:01 +0000 Received: from cross.elm.relay.mailchannels.net ([23.83.212.46]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wOwVq-00000000AMv-0d63 for pgsql-hackers@postgresql.org; Mon, 18 May 2026 11:52:00 +0000 X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 5146D403218; Mon, 18 May 2026 11:51:57 +0000 (UTC) Received: from pdx1-sub0-mail-a249.dreamhost.com (100-98-7-230.trex-nlb.outbound.svc.cluster.local [100.98.7.230]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E9346401404; Mon, 18 May 2026 11:51:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; d=mailchannels.net; s=arc-2022; cv=none; t=1779105117; b=FcadJNGGl86UsBxzoTRBKLk92em5aAfQh59k/GevII7oW1/JctaTcXiWxa6yYOyCYqIqXJ u0sVDBPrxOO6dxkcsXddn9zjg2uzF2vRetxcsUVLYFqoK0wwbMsWtBdkQleU8kgGuf/4K5 MaJpJ7+djlVw/QqOk/Yz8nJahpw9Fsh1HdWdDPdOfz/zLwlSpMa9e39iUBBhB41OWxt8bo HNjdgUbwnEqxOiqlU/eC+SiAQGPPFQzSxhH+FyLEx4JHFDYeEXpBtjJ2ZAyBJDB2eGo1Es IFrXlq8SJW6oTeAuk63NlKUB7LtduZ34UTBWnoZW7D1/hkApSy+6q7iAnKxQJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1779105117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/JV7pC55oyMiY0HGr/DICf2B9iPnCgb2kr7IGYa14RY=; b=4aYz3mR0mweGs/O6JJkcW2Kac2kTc+XqVl/Tc8h2Li/3YudOV4xejxcxJs7D+WqDB9NVWo rP3RVl3GGlPIOINtFI06BIOTfehuKJigulbkEGajTI/WNEu0pR7VU2SLX2nOCfruM4EMQB lgpzEwfpKZCg17i2Pd23jGKodFV/0ogyIuMICk5IAf4yy7mAVoxN6AZhIocATF/ScGC+1B ZW9v6NxaL1uza3YtlI/BJJCDMFh685Fz/iMqYZC143MUxz+RnxuuQRaHCPQpPiQlRhFcp1 DVvu7Z7HUYOyE0ysxdk5I6gqRRc80F5ujorXqVgIy+3hObGCja4DkmQS3QBphg== ARC-Authentication-Results: i=1; rspamd-6cd998c8-g4b2l; auth=pass smtp.auth=dreamhost smtp.mailfrom=nico@cryptonector.com X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|nico@cryptonector.com X-MailChannels-Auth-Id: dreamhost X-Abortive-Shade: 3382493d4f37ad48_1779105117216_545343560 X-MC-Loop-Signature: 1779105117216:3946241364 X-MC-Ingress-Time: 1779105117216 Received: from pdx1-sub0-mail-a249.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.98.7.230 (trex/7.1.5); Mon, 18 May 2026 11:51:57 +0000 Received: from ubby (unknown [24.28.102.31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by pdx1-sub0-mail-a249.dreamhost.com (Postfix) with ESMTPSA id 4gJx3w1ltTz103y; Mon, 18 May 2026 04:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1779105116; bh=/JV7pC55oyMiY0HGr/DICf2B9iPnCgb2kr7IGYa14RY=; h=Date:From:To:Cc:Subject:Content-Type:Content-Transfer-Encoding; b=peV8mN/Gu6R6rhP5hOCO5WNysAMbklbByLTO+s0l02MCSToSPg9H+zTnI9sj9wD59 jTwKOKYMzBXd84HKZcBVTsl+A49Eb9nwGjNbut3SBoggJUZh7dlVZlc43hGBkd3+w+ Z+ZjZ+h4mjQZhN4fLxnv71Z5WMA3VDIOvG/YZLw4bbWigO/UH6BxgdiuExn88g6472 0vfyTGAcc/Z5nfEmPi3Rh9MH2Z6pt1nhsW8Fx/qbCBcUzVk995+U21JhUP5nAqXfVa /n0LI17Opbr/rbj5LNhzYdBs9FTzVR85Gtfe5JuQBNzxFfc3fHzg7vBq+NYv+40qRc 12sBROw970okQ== Date: Mon, 18 May 2026 06:51:53 -0500 From: Nico Williams To: Jeff Davis Cc: Daniel Verite , Peter Eisentraut , Robert Haas , Pgsql-Hackers Subject: Re: Support LIKE with nondeterministic collations Message-ID: References: <9c81e66f-0e06-4756-b9a2-d7b7d46379c1@manitou-mail.org> <8a4cbd9099f7c9dbe5eea78b582ab58c06c8d09a.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8a4cbd9099f7c9dbe5eea78b582ab58c06c8d09a.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jul 31, 2024 at 03:26:34PM -0700, Jeff Davis wrote: > On Fri, 2024-05-03 at 16:58 +0200, Daniel Verite wrote: > > In other words it says that > > > >   col LIKE 'smith%' collate "nd" > > > > is equivalent to: > > > >   col >= 'smith' collate "nd" AND col < U&'smith\ffff' collate "nd" > > That logic seems to assume something about the collation. If you have a > collation that orders strings by their sha256 hash, that would entirely > break the connection between prefixes and ranges, and it wouldn't work. The hash of what? each character's names or canonical representations in some UTF? If so, then, to maintain the above equivalence one would have to alter the definition of this 'hash-based collation' so that U+FFFF is always "last". > Is there something about the way collations are defined that inherently > maintains a connection between a prefix and a range? [...] Yes: rules like the one Daniel described. > [...]? Does it remain > true even when strange rules are added to a collation? There are 'strange rules' which cannot be used in defining a collation, as the result would not then be a collation. Nico --