All Products
Search
Document Center

PolarDB:ALTER TABLE MOVE PARTITION

Last Updated:Oct 23, 2025

Moves a partition or subpartition to a different tablespace. Because PolarDB uses a shared distributed storage architecture where multiple compute nodes share a single copy of data, it does not support physical tablespaces. ALTER TABLE MOVE PARTITION is supported for compatibility only; it does not change the data's physical storage location.

Note

To run this command, you must be the table owner or have the ALTER permission for the table.

Synopsis

ALTER TABLE MOVE PARTITION has two forms:

  • Move a partition to a new tablespace:

ALTER TABLE table_name 
  MOVE PARTITION partition_name 
   TABLESPACE tablespace_name;
  • Move a subpartition to a new tablespace:

ALTER TABLE table_name 
  MOVE SUBPARTITION subpartition_name 
   TABLESPACE tablespace_name;

Parameters

Parameter

Required

Description

Example

table_name

Yes

The name of the table that contains the partition.

archived_logs

partition_name

Yes

The name of the partition to move.

p_2022_q1

subpartition_name

Yes

The name of the subpartition to move.

sp_2023_asia

tablespace_name

Yes

The name of the destination tablespace.

tbs_cold_data