Chris <rc@networkz.ch> writes:
> Or maybe hacking my own pg_trgm wouldn't be so hard and could be fun, do
> I pretty much just need to change the emitted tokens or will this lead
> to significant complications in the operators, indexes etc.?
See KEEPONLYALNUM in pg_trgm/trgm.h ...
Now, using a custom-modified pg_trgm module in production is likely
not something you want to do for long. It might be interesting to
look into whether the relatively-recently-invented "operator class
parameter" mechanism could be exploited to allow this behavior to be
customized without hacking C code.
regards, tom lane