On 04.06.25 05:22, Jeff Davis wrote:
> This proposal would add that dependency information, and importantly,
> would be careful about which dependency entries are required for
> particular expressions and which are not.
> Introduce three new options when creating or altering a function,
> operator or index AM: COLLATE, CTYPE, or EQUALITY, representing the
> operations that the object is sensitive to.
Yes, this has been on my todo list since the day collations were added,
but for a different reason: We should be able to detect a failed
collation derivation at parse time. This is according to the SQL
standard, and also because it's arguably a better user experience. But
we don't do that, so we have to check it at run time, which is what all
these errmsg("could not determine which collation to use for string
comparison") checks are for.
The reason we don't do it at parse time is that we don't have the
information which functions care about collations, which is exactly what
you are proposing here to add.
In my mind, I had this project listed under "procollate", but feel free
to use a different name. But I would consider making this one setting
with multiple values instead of multiple boolean settings.
I don't mean to say that you should implement the parse-time collation
derivation check as well, but we should design the catalog metadata so
that that is possible.