我有col
数据类型的列CHARACTER VARYING
我需要该列作为gin
索引。如果尝试直接将 gin 索引设置为列,则返回错误:
data type character varying has no default operator class for access method "gin"
HINT: You must specify an operator class for the index or define a default operator class for the data type
如果尝试:
create index col_vector
on mytable
using gin (to_tsvector(col))
我收到错误: functions in index expression must be marked IMMUTABLE
如何gin
为列创建索引CHARACTER VARYING
?
ps 我需要这个来进行全文搜索