Re: Does the POSITION() function takes into account the COLLATION... or not ?!?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Does the POSITION() function takes into account the COLLATION... or not ?!?
Дата
Msg-id 3324021.1645028326@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Does the POSITION() function takes into account the COLLATION... or not ?!?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tue, Feb 15, 2022 at 11:17 AM PG Doc comments form <
> noreply@postgresql.org> wrote:
>> ==> up to here, this seems pretty enough to conclude that POSITION()
>> doesn't
>> care at all about COLLATION and always perform a byte search.

> How collations behave is documented, in particular:

> "A collation is either deterministic or nondeterministic. A deterministic
> collation uses deterministic comparisons, which means that it considers
> strings to be equal only if they consist of the same byte sequence."

Right.  POSITION does indeed do bytewise search, which is a legal
implementation for any deterministic collation, but perhaps not
for a nondeterministic one.  Thus, it throws a feature-not-supported
error if asked to use a nondeterministic collation.  As you say,
this is far from the only function that acts that way.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Does the POSITION() function takes into account the COLLATION... or not ?!?
Следующее
От: Jian He
Дата:
Сообщение: range data type size not mention in docs.