2

I'm using a tsquery field in order to pre-compute batch searches, but I'm encountering this error while updating a tsquery field on a table:

ERROR:  row is too big: size 10704, maximum size 8160

The error is given when I'm updating the field with the resulting tsquery of a long string (2439 ASCII chars, with no multibyte char). My guess is that the tsquery it's a binary format and its weight is higher than the original string, maybe because of additional information stored by the format.

There seems to be no limit imposed by the to_tsquery() function itself, but the limit is imposed for the field size, though,

Here is the field definition:

ALTER TABLE public.tpl ADD content_ts_query TSQUERY NULL;

Is it possible to change this setting? If not, how long can be the string so it can fit it inside the field?

Pg version: 9.3

  • 1
    I've seen this error not from the table column, but rather from the index on it. Do you have an index on this column? If you have a gist index, try changing it to gin. – jjanes Oct 16 '15 at 17:28
  • Sadly, it's not the case. There are no indexes on that column. – paul.ago Oct 17 '15 at 11:43
  • 1
    Yes, I see that tsquery is not toastable. I don't know why that decision was made. You could making the column be a text column, and then cast the tsquery to text before storage and cast it back to tsquery on use. – jjanes Oct 18 '15 at 4:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.