Re: Does the POSITION() function takes into account the COLLATION... or not ?!? - Mailing list pgsql-docs

From Tom Lane
Subject Re: Does the POSITION() function takes into account the COLLATION... or not ?!?
Date
Msg-id 3324021.1645028326@sss.pgh.pa.us
Whole thread Raw
In response to Re: Does the POSITION() function takes into account the COLLATION... or not ?!?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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 by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Does the POSITION() function takes into account the COLLATION... or not ?!?
Next
From: Jian He
Date:
Subject: range data type size not mention in docs.