# Indexing crash on migration 6.8

**URL:** https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529
**Category:** Developer
**Created:** [September 20, 2023, 9:31am UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529 "2023-09-20T09:31:38Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)
#### Post date: [September 20, 2023, 9:31am UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529/1 "2023-09-20T09:31:38Z")

</div>

Moving from 6.4 to 6.8, the update had crashed with:

```auto
68109 139803431196480 [2023-09-20 09:20:46,433] INFO trytond.modules index:create ir.translation
Traceback (most recent call last):
  File "/home/vant/Documentos/GitLab/customer/.venv/bin/trytond-admin", line 31, in <module>
    admin.run(options)
  File "/home/vant/Documentos/GitLab/customer/.venv/lib/python3.8/site-packages/trytond/admin.py", line 57, in run
    pool.init(update=options.update, lang=list(lang),
  File "/home/vant/Documentos/GitLab/customer/.venv/lib/python3.8/site-packages/trytond/pool.py", line 167, in init
    restart = not load_modules(
  File "/home/vant/Documentos/GitLab/customer/.venv/lib/python3.8/site-packages/trytond/modules/ __init__.py", line 456, in load_modules
    _load_modules(update)
  File "/home/vant/Documentos/GitLab/customer/.venv/lib/python3.8/site-packages/trytond/modules/ __init__.py", line 424, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/home/vant/Documentos/GitLab/customer/.venv/lib/python3.8/site-packages/trytond/modules/ __init__.py", line 305, in load_module_graph
    model._update_sql_indexes()
  File "/home/vant/Documentos/GitLab/customer/.venv/lib/python3.8/site-packages/trytond/model/modelsql.py", line 489, in _update_sql_indexes
    table_h.set_indexes(cls._sql_indexes)
  File "/home/vant/Documentos/GitLab/customer/.venv/lib/python3.8/site-packages/trytond/backend/postgresql/table.py", line 501, in set_indexes
    cursor.execute(
  File "/home/vant/Documentos/GitLab/customer/.venv/lib/python3.8/site-packages/trytond/backend/postgresql/database.py", line 68, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.ProgramLimitExceeded: index row size 2976 exceeds btree version 4 maximum 2704 for index "idx_ir_translation_17959a6671e3a3c93dfdf2fc3640d645"
DETAIL: Index row references tuple (392,11) in relation "ir_translation".
HINT: Values larger than 1/3 of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text indexing.

```

I don’t know what caused or how it can be solved, and/or if it’s something related to some custom code.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 20, 2023, 10:56am UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529/2 "2023-09-20T10:56:30Z")

</div>

I do not think it is really usable to have large Text field translatable.  
With [Support btree\_gin extension (#12480) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue12480) GIN index could be used for such case which has no limit.

---

<div class="post-metadata">

### Author: ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)
#### Post date: [September 20, 2023, 11:03am UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529/3 "2023-09-20T11:03:58Z")

</div>

Sorry, I don’t understand what you mean.

1. Is this only affecting my module or it’s core? Should be reported?
2. Is there any workaround I can do to update while it’s being fixed?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 20, 2023, 4:20pm UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529/4 "2023-09-20T16:20:28Z")

</div>

> [@acaubet](#):
>
> Is this only affecting my module or it’s core? Should be reported?

It depends on the data. But it can not be fixed as it is a limitation of PostgreSQL index.

> [@acaubet](#):
>
> Is there any workaround I can do to update while it’s being fixed?

It depends on the source of the problem.  
If it is a custom Text field, probably it should not be translatable.  
If it is a standard Text field, user should be questioned about why they put such large amount of text in a translatable field.

---

<div class="post-metadata">

### Author: ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)
#### Post date: [September 20, 2023, 4:38pm UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529/5 "2023-09-20T16:38:42Z")

</div>

I have a better understanding now, thanks.

> [@ced](#):
>
> It depends on the data. But it can not be fixed as it is a limitation of PostgreSQL index.

Should we make size required on Text translatable fields to prevent this? What is the max size allowed that prevents this?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 21, 2023, 8:37am UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529/6 "2023-09-21T08:37:11Z")

</div>

It depends on the backend and even on the version of the backend.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 29, 2023, 3:09pm UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529/7 "2023-09-29T15:09:17Z")

</div>

I think we could add a size constraint automatically on `Char` and `Text` fields that are translated if they have any size. The value could be defined as a configuration value (so system admin can modify it according to the backend configuration).

---

<div class="post-metadata">

### Author: ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)
#### Post date: [August 8, 2025, 11:10am UTC](https://discuss.tryton.org/t/indexing-crash-on-migration-6-8/6529/8 "2025-08-08T11:10:06Z")

</div>

FTR, [Add size limit on translated fields](https://foss.heptapod.net/tryton/tryton/-/issues/12713)
