All Products
Search
Document Center

PolarDB:ALTER TABLESPACE

Last Updated:Mar 28, 2026

ALTER TABLESPACE modifies the definition of an existing tablespace.

Prerequisites

To run ALTER TABLESPACE, you must own the tablespace. To change the owner, you must also be a direct or indirect member of the new owning role. Superusers have these privileges automatically.

Synopsis

ALTER TABLESPACE name RENAME TO new_name
ALTER TABLESPACE name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
ALTER TABLESPACE name SET ( tablespace_option = value [, ... ] )
ALTER TABLESPACE name RESET ( tablespace_option [, ... ] )

Parameters

ParameterDescription
nameThe name of an existing tablespace.
new_nameThe new name for the tablespace. Names beginning with pg_ are reserved for system tablespaces and cannot be used.
new_ownerThe new owner of the tablespace.
tablespace_optionA tablespace parameter to set or reset. See Tablespace options for available values.

Tablespace options

The tablespace_option parameter accepts the following values:

OptionDescription
seq_page_costOverrides the planner's estimate of the cost of a sequential page read for tables in this tablespace.
random_page_costOverrides the planner's estimate of the cost of a non-sequential page read for tables in this tablespace.
effective_io_concurrencyOverrides the executor's prefetching behavior for tables in this tablespace.
maintenance_io_concurrencyOverrides the executor's prefetching behavior for tables in this tablespace.

These options are useful when a tablespace resides on a disk that is significantly faster or slower than the rest of the I/O subsystem. The values override the corresponding server-level configuration parameters of the same name.

Examples

Rename a tablespace:

ALTER TABLESPACE index_space RENAME TO fast_raid;

Change the owner of a tablespace:

ALTER TABLESPACE index_space OWNER TO mary;

What's next