# Table partitioning

**URL:** https://discuss.tryton.org/t/table-partitioning/9189
**Category:** Developer
**Created:** [April 7, 2026, 3:37pm UTC](https://discuss.tryton.org/t/table-partitioning/9189 "2026-04-07T15:37:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bell](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@bell](https://discuss.tryton.org/u/bell)
#### Post date: [April 7, 2026, 3:37pm UTC](https://discuss.tryton.org/t/table-partitioning/9189/1 "2026-04-07T15:37:09Z")

</div>

I need to divide the data in all my application tables by year. It seems like table partitioning would be the ideal solution. But Tryton doesn’t have this option? If I add partitioning to the tables, will there be any issues with upgrading the module?

---

<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: [April 8, 2026, 6:59am UTC](https://discuss.tryton.org/t/table-partitioning/9189/2 "2026-04-08T06:59:52Z")

</div>

Apparently it is not possible to change the schema of a partitioned table: [PostgreSQL: Documentation: 18: 5.12.&nbsp;Table Partitioning](https://www.postgresql.org/docs/current/ddl-partitioning.html#DDL-PARTITIONING-DECLARATIVE-LIMITATIONS)  
So the upgrade process for such table will need to be done manually prior to the Tryton upgrade in such way that Tryton will not try to make any alteration on the table.

---

<div class="post-metadata">

### Author: ![JCavallo](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@JCavallo](https://discuss.tryton.org/u/JCavallo)
#### Post date: [April 8, 2026, 7:01am UTC](https://discuss.tryton.org/t/table-partitioning/9189/3 "2026-04-08T07:01:32Z")

</div>

Also IIRC the partition key must be part of the primary key for the table, which is not really compatible with Tryton IDs.

---

<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: [April 8, 2026, 7:06am UTC](https://discuss.tryton.org/t/table-partitioning/9189/4 "2026-04-08T07:06:39Z")

</div>

Tryton does not check nor enforce a specific primary key. It just checks that a column `id` exists and it must have a serial sequence attached.
