2 .\" Title: ALTER TABLESPACE
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "ALTER TABLESPACE" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 ALTER_TABLESPACE \- change the definition of a tablespace
35 ALTER TABLESPACE \fIname\fR RENAME TO \fInew_name\fR
36 ALTER TABLESPACE \fIname\fR OWNER TO { \fInew_owner\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
37 ALTER TABLESPACE \fIname\fR SET ( \fItablespace_option\fR = \fIvalue\fR [, \&.\&.\&. ] )
38 ALTER TABLESPACE \fIname\fR RESET ( \fItablespace_option\fR [, \&.\&.\&. ] )
42 \fBALTER TABLESPACE\fR
43 can be used to change the definition of a tablespace\&.
45 You must own the tablespace to change the definition of a tablespace\&. To alter the owner, you must also be able to
47 to the new owning role\&. (Note that superusers have these privileges automatically\&.)
52 The name of an existing tablespace\&.
57 The new name of the tablespace\&. The new name cannot begin with
58 pg_, as such names are reserved for system tablespaces\&.
63 The new owner of the tablespace\&.
66 \fItablespace_option\fR
68 A tablespace parameter to be set or reset\&. Currently, the only available parameters are
70 \fIrandom_page_cost\fR,
71 \fIeffective_io_concurrency\fR
73 \fImaintenance_io_concurrency\fR\&. Setting these values for a particular tablespace will override the planner\*(Aqs usual estimate of the cost of reading pages from tables in that tablespace, and how many concurrent I/Os are issued, as established by the configuration parameters of the same name (see
76 effective_io_concurrency,
77 maintenance_io_concurrency)\&. This may be useful if one tablespace is located on a disk which is faster or slower than the remainder of the I/O subsystem\&.
90 ALTER TABLESPACE index_space RENAME TO fast_raid;
96 Change the owner of tablespace
103 ALTER TABLESPACE index_space OWNER TO mary;
111 \fBALTER TABLESPACE\fR
112 statement in the SQL standard\&.
114 CREATE TABLESPACE (\fBCREATE_TABLESPACE\fR(7)), DROP TABLESPACE (\fBDROP_TABLESPACE\fR(7))