Re: Support LIKE with nondeterministic collations

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pgsql-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support LIKE with nondeterministic collations
Date: 2024-08-01 19:55:55
Message-ID: 9364e6e6-9cc2-4eb1-91b1-dc4c780af597@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis wrote:

> > 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.

Indeed I would not trust this trick to work outside of ICU collations.

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-08-01 20:34:51 Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW
Previous Message Kirill Reshke 2024-08-01 19:13:18 Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW