gin index operator class functions in sql?

Started by Andrew Geeryover 9 years ago2 messagesgeneral
Jump to latest
#1Andrew Geery
andrew.geery@gmail.com

For a custom type to be used in a btree index, it is possible to create a
function in SQL (as opposed to C) that is used in the create operator class
statement to specify how equality is defined. A good example of this is
presented inhttp://www.cybertec.at/2013/11/operator-classes-explained/.

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? According to the
documentation, there are four functions that would need to be defined:
overlap, contains, is contained by and equal [1]https://www.postgresql.org/docs/9.5/static/xindex.html. If so, what would the
SQL function signature be?

Thanks
Andrew

[1]: https://www.postgresql.org/docs/9.5/static/xindex.html

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Geery (#1)
Re: gin index operator class functions in sql?

Andrew Geery <andrew.geery@gmail.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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general