我已经安装了pg_trgm
模块。
pg_trgm | 1.0 | extensions | text similarity measurement and index ...
模式集是
extensions
。要使用它,我需要运行类似以下选择的内容:extensions.similarity('hello','hallo');
我正在尝试使用%
运算符运行一条语句,但收到了以下消息。
mydb=# select * from rssdata where description % 'Brazil';
ERROR: operator does not exist: character varying % unknown
LINE 1: select * from rssdata where description % 'Brazil';
^
HINT: No operator matches the given name and argument type(s).
You might need to add explicit type casts.
运行%
或<->
操作符需要哪些条件?
pg_catalog
不是一个好主意。这应该为系统对象保留。将扩展安装到public
模式或专用的extension
模式,并确保在search_path中包含该模式。不要滥用pg_catalog
! - Erwin BrandstetterCREATE EXTENSION IF NOT EXISTS btree_gin WITH SCHEMA extensions;``CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA extensions;
执行后应该可以正常工作。 - bersen