CREATE INDEX message_fulltext_idx ON feedback USING gin(to_tsvector(message));
ERROR: functions in index predicate must be marked IMMUTABLE
如何避免这种情况?
答案 0 :(得分:19)
您需要包含可选的config参数。没有它,该函数不是不可变的。例如,如果您想要标准的英文文本解析:
CREATE INDEX message_fulltext_idx ON feedback
USING gin(to_tsvector('english', message));