Tomas Vondra <tomas@vondra.me> writes:
> On 11/15/24 07:17, Tender Wang wrote:
>> Can we report errors not crash if users pass an unexpected function?
Read up on the halting problem.
> I think it might be improved to do some checks, yes. The CREATE OPERATOR
> CLASS should be able to signatures of the functions - it's AM-specific,
> and there's a limit how much can be checked. For example these functions
> have "internal" arguments, which can be an arbitrary pointer.
We already have amvalidate, which would certainly have caught anything
as egregiously wrong as this example. I do not remember why that's
not a forced step of CREATE OPERATOR CLASS, but I'm sure there
was a good reason for making it separate.
regards, tom lane