Feasibility of altering table partition

Hello Team,
Can you let me know if it is feasible to alter table’s partition if table has millions of partitioned data ?
If it is possible than what happen with old partitioned data.
Thanks in advance.

Hi @kkhatri

What do you mean by altering the partition?
Changing the number of shards typically shouldn’t be a problem.

Not for shards.
let me give scenario.
I have one table which has partition with Year,Month,Week.
Now i want to make partition on Year,Month,Week,Day (by adding Day column in partition).

Is this possible ?



No changing the partition keys is not possible on an existing table. But you could increase the number of shards for a partition (e.g. if partitions get too big in size).

also if you want to partition by week/day you probably should use date_trunc('week',timestamp)

Thanks for your input and valuable time.

1 Like