Andrew Geery <andrew(dot)geery(at)gmail(dot)com> writes:
> Is it possible to define functions in SQL (as opposed to C) to do the same
> thing -- create an operator class -- for a gin index?
Afraid not; several of those APIs are C-specific.
regards, tom lane