20
CREATE INDEX message_fulltext_idx ON feedback USING gin(to_tsvector(message));
错误:索引谓词中的函数必须标记为 IMMUTABLE 

如何避免这种情况?

4

1 回答 1

23

You need to include the optional config parameter. Without it, the function is not immutable. For example, if you want the standard English text parsing:

CREATE INDEX message_fulltext_idx ON feedback
  USING gin(to_tsvector('english', message));
于 2012-04-05T12:40:20.120 回答