Thread: UPDATE failed with 'ERROR: index row requires 8968 bytes, maximum size is 8191'

UPDATE failed with 'ERROR: index row requires 8968 bytes, maximum size is 8191'

From
Lonni J Friedman
Date:
Greetings,
I've got a postgresql-8.4.7 instance running on 64bit Linux that
recently failed a SQL UPDATE with the error:
ERROR:  index row requires 8968 bytes, maximum size is 8191

The index in question that failed is defined as:
"results_failinfo_index" btree (failinfo)

Its extermely rare, but not impossible that this will happen again
(most of the updates to this table column are significantly smaller in
size).  Therefore, I'd rather not redesign the table schema if I can
come up with some safety net work around.

It looks like this describes my situation perfectly (
http://tiki.org/TikiPostgres#Saving_large_amounts_of_text. ).  If I'm
understanding this correctly, it sounds like I could attempt this
workaround, and I need to add a where clause to the index to limit the
length of the data that gets indexed?  If so, what would I specify for
the upper limit on the length of the data?

thanks!