Можете еще такой вариант добавить:
https://www.postgresql.org/docs/9.1/static/pgtrgm.html
F.35.1. Trigram (or Trigraph) Concepts
A trigram is a group of three consecutive characters taken from a string. We can measure the similarity of two strings by counting the number of trigrams they share. This simple idea turns out to be very effective for measuring the similarity of words in many natural languages.