Re: [19] Proposal: function markers to indicate collation/ctype sensitivity - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [19] Proposal: function markers to indicate collation/ctype sensitivity
Date
Msg-id 64993306-d23b-4634-9a37-e417f5c5d256@eisentraut.org
Whole thread Raw
In response to Re: [19] Proposal: function markers to indicate collation/ctype sensitivity  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On 05.06.25 22:57, Jeff Davis wrote:
> On Tue, 2025-06-03 at 20:22 -0700, Jeff Davis wrote:
>> EQUALITY marker: indicates that the function or index AM depends on
>> CollOid for the equality semantics of the input expression. Examples:
>> texteq(), btree AM, hash AM. (Note: EQUALITY is only important for
>> non-
>> deterministic collations and we might want to omit it if too many
>> functions qualify, but it helps illustrate the rest of the proposal
>> so
>> I will leave it in for now.)
> 
> I had trouble contriving a case where tracking EQUALITY as a separate
> marker would be practically useful. When we allow non-deterministic
> collations at the database level in the future, it might be useful in a
> case like:
> 
>      CREATE TABLE r(t TEXT, CHECK(length(t) <= 10));
> 
> because length() doesn't care about equality, so it would have no
> dependency on the database collation even if it were, for example,
> case-insensitive.

But such a length() function would also not care about the "collate" or 
"ctype" markers.  So it would probably not be marked at all.




pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: [V2] Adding new CRC32C implementation for IBM S390X
Next
From: Peter Eisentraut
Date:
Subject: Re: [19] Proposal: function markers to indicate collation/ctype sensitivity