The error you are getting is referring to the Citus partition column of the distributed partitioned table, i.e., the distribution column. In Citus, you cannot modify the value of the distribution column. The name partition column in Citus can be a bit confusing in this case, so better to address it as distribution column. Think of your error like this:
ERROR: modifying the value of the distribution column of rows is not allowed
Is there any way to enable this kind of row movement in Citus?
Or do I need to manually delete and reinsert the row?
There is no way to modify the value of the distribution column in Citus with an UPDATE statement. Your second question is the only way to modify the value of the distribution column in Citus.
- Is there a recommended workaround when working with partition keys in Citus?
Your table contact_details
is partitioned by range on the created_at
column and judging by the error you are facing during UPDATE
, your table is also distributed on the created_at
column. The workaround, and the recommended practice, is to actually distribute the table on the id
column. This way, it will work, and moreover Citus will route your UPDATE
query to the relevant shard because that query filters on the id
column, and Citus will execute it effectively.