I try using django-application (function update_or_create ) to update_or_create data from the excel-file to the database in the jsonb field. The data in the cells is long - several cells, in one of them there are 8500 characters, the rest up to 250 characters, everything is written in one field. Data recording passes with an error.

If you shorten the text in the longest field to 5500 characters, the recording is successful, but if you leave 5501, then with an error.

I do not see a limit of 5500 characters in jsonb. Please tell me where to look for the problem?

    1 answer 1

    The problem turned out to be that the jsonb field in this model is indexed by the db_index=True, command db_index=True, which creates a standard b-tree индекс . Its maximum length is 2712 characters and, apparently, this length depends on the length of the data.

    Theoretically, it is possible to change the index type of the gist in the DBMS manually, this should help. It would be great if this could be done in a django model, but I don’t know how.