m621
m621

Reputation: 331

Postgres fulltext index

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

Answers (1)

kgrittn
kgrittn

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

Related Questions