PG Bug reporting form <noreply@postgresql.org> writes:
> CREATE FUNCTION my_int4_sort(int4,int4) RETURNS int LANGUAGE sql
> AS $$ SELECT CASE WHEN $1 = $2 THEN 0 WHEN $1 > $2 THEN 0 ELSE -1 END;
> $$;
> CREATE OPERATOR CLASS test_int4_ops FOR TYPE int4 USING btree AS
> OPERATOR 5 > (int4,int4), FUNCTION 1 my_int4_sort(int4,int4);
This is a broken operator class definition (it's missing most of the
expected operators for a btree opclass). It's not exactly surprising
that it causes problems. I have zero desire to try to make the system
bulletproof against incorrectly-made opclasses.
regards, tom lane