我正在尝试使用Postgres中的相似度函数来做一些模糊的文本匹配,但是每当我尝试使用它,我得到错误:
function similarity(character varying,unknown) does not exist
function similarity(text,text) does not exist
我的查询是:
SELECT (similarity("table"."field"::text,%s::text)) AS "similarity","table".* FROM "table" WHERE similarity > .5 ORDER BY "similarity" DESC LIMIT 10
我需要做些什么来激发pg_trgm吗?