# Partitioning table with pt-online-schema-change

**URL:** <https://forums.percona.com/t/partitioning-table-with-pt-online-schema-change/22640>\
**Category:** MySQL & MariaDB\
**Created:** [June 7, 2023, 2:53pm UTC](https://forums.percona.com/t/partitioning-table-with-pt-online-schema-change/22640 "2023-06-07T14:53:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dba1](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dba1/32/24223_2.png) [@Dba1](https://forums.percona.com/u/Dba1)\
**Post date:** [June 7, 2023, 2:53pm UTC](https://forums.percona.com/t/partitioning-table-with-pt-online-schema-change/22640/1 "2023-06-07T14:53:15Z")

</div>

Hello guys,  
Is it a seamless effort to partition a table with pt-online-schema-change than using the traditional Alter table in mysql client. I have been using pt-online-schema-change for years now and I must say that the result were outstanding. Recently, I’m trying to use this tool to partition my table but I have been getting some errors

( in cleanup ) Error altering new table ‘mydatabse. \_mytable\_new’: “DBD : : mysql : : db do failed: you have an error in your SQL syntax ; check the manual that corresponds yo your Mariadb server version for the right syntax to use near Jun 7;16:45:10 CEST 2023)  
PARTITION BY RANGE (TO\_DAYS(wed jun 7 16:46:10 ….::

Note: I’m thinking the partition function using is correct by the date Function (TO\_DAYS) might be the issue here .

Any help

---

<div class="post-metadata">

**Author:** ![kedarpercona](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kedarpercona/32/809_2.png) [@kedarpercona](https://forums.percona.com/u/kedarpercona)\
**Post date:** [June 7, 2023, 3:17pm UTC](https://forums.percona.com/t/partitioning-table-with-pt-online-schema-change/22640/2 "2023-06-07T15:17:00Z")

</div>

Hello @Dba1,  
Would you like to share your table definition to give more clarity along with MariaDB version?  
Also post the command that you have used for `pt-online-schema-change`.

Did you manually type this (just confirming about that typo)  
`check the manual that corresponds yo your Mariadb server version`

Thanks,  
K
