Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PG::ProgramLimitExceeded: ERROR: index row requires 13904 bytes, maximum size is 8191

I have one field

t.text "po_description", null: false

and i'm trying to save 200-300 lines of text in this field and getting overflow error :-

PG::ProgramLimitExceeded: ERROR: index row requires 13904 bytes, maximum size is 8191 : INSERT INTO "po_terms" ("company_id", "po_description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"

Note: - i'm using postgresql db

How to fix it, any help would be appreciated. thanks

like image 464
Anand Avatar asked Mar 07 '23 10:03

Anand


1 Answers

The error message says exactly what the problem is. You have indexed the "po_description" column and it exceeds the maximum index size.

An index on such large columns is unlikely to be useful anyway. Simplest solution is just to remove it.

like image 60
Richard Huxton Avatar answered Apr 26 '23 03:04

Richard Huxton