Code freak
Code freak

Reputation: 695

postgresql text search: 2712 index size limit error

I'm trying to use postgresql fulltext functionality to add text-search to our application.

Currently, it gives the error

index row size 4016 exceeds maximum 2712 for index

I got this for a document that was 3880 (english) in char length. Does this mean that postgres fts can't be used for larger documents ? 3880 isn't all that large ? The error appears when I try to update the index, so one solution would be to not use an index at all but wouldn't that affect the search performance ?

I'm new to postgresql in general and am really sure that I must be doing something really wrong.

Upvotes: 3

Views: 7499

Answers (2)

Chris Travers
Chris Travers

Reputation: 26464

If you are trying to index a text field for fts, my suggestion is that you should index a tsvector based on the text. Something like

CREATE INDEX my_fts_idx ON my_table(to_tsvector(mytext));

A tsvector is much smaller than the full text of the column also.

Upvotes: 1

bcackerman
bcackerman

Reputation: 1554

I found out that you'll get this error when you try to index a text field, remove that index and you'll be fine.

Upvotes: -1

Related Questions