Re: insensitive collations

Поиск
Список
Период
Сортировка
От Jim Finnerty
Тема Re: insensitive collations
Дата
Msg-id 1616528764665-0.post@n3.nabble.com
обсуждение исходный текст
Ответ на Re: insensitive collations  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: insensitive collations  (Jim Finnerty <jfinnert@amazon.com>)
Список pgsql-hackers
Has any progress been made on supporting LIKE for nondeterministic
collations?

The pattern as well as the expresion needs to use collation-aware character
comparisons, so for a suitable collation where ß compares equally to ss:

SELECT * from table WHERE name LIKE '%ß%'
yields
Brian Bruß
Steven Sossmix

and even if the pattern contains only single-byte UTF-8 characters, a
non-accented character in the first 127 might compare equally to a two-byte
accented character in the first argument, so the comparisons as well as the
character-advancing logic must be collation-aware.  This seems to imply that
for the general nondeterministic case we need to rewrite the algorithm to
use ICU functions for advancing to the next character and for comparing
characters at the current position in the pattern and string.  Is that
accurate?

for a database with UTF8 encoding and a collation that is case-insenstitive
but accent-sensitive, and where the pattern contains only single-byte
characters or wildcard characters, would LIKE and ILIKE be correct with the
current per-byte implementation - albeit without any index exploitation?




-----
Jim Finnerty, AWS, Amazon Aurora PostgreSQL
--
Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_amcheck contrib application
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: pg_amcheck contrib application