Reputation: 331
CREATE INDEX message_fulltext_idx ON feedback USING gin(to_tsvector(message));
ERROR: functions in index predicate must be marked IMMUTABLE
How to avoid this?
Upvotes: 23
Views: 4425
Reputation: 19471
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));
Upvotes: 28