2 doc/src/sgml/ref/alter_tablespace.sgml
3 PostgreSQL documentation
6 <refentry id=
"sql-altertablespace">
7 <indexterm zone=
"sql-altertablespace">
8 <primary>ALTER TABLESPACE
</primary>
12 <refentrytitle>ALTER TABLESPACE
</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
18 <refname>ALTER TABLESPACE
</refname>
19 <refpurpose>change the definition of a tablespace
</refpurpose>
24 ALTER TABLESPACE
<replaceable>name
</replaceable> RENAME TO
<replaceable>new_name
</replaceable>
25 ALTER TABLESPACE
<replaceable>name
</replaceable> OWNER TO {
<replaceable>new_owner
</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
26 ALTER TABLESPACE
<replaceable>name
</replaceable> SET (
<replaceable class=
"parameter">tablespace_option
</replaceable> =
<replaceable class=
"parameter">value
</replaceable> [, ... ] )
27 ALTER TABLESPACE
<replaceable>name
</replaceable> RESET (
<replaceable class=
"parameter">tablespace_option
</replaceable> [, ... ] )
32 <title>Description
</title>
35 <command>ALTER TABLESPACE
</command> can be used to change the definition of
40 You must own the tablespace to change the definition of a tablespace.
41 To alter the owner, you must also be able to
<literal>SET ROLE
</literal>
42 to the new owning role.
43 (Note that superusers have these privileges automatically.)
49 <title>Parameters
</title>
53 <term><replaceable class=
"parameter">name
</replaceable></term>
56 The name of an existing tablespace.
62 <term><replaceable class=
"parameter">new_name
</replaceable></term>
65 The new name of the tablespace. The new name cannot
66 begin with
<literal>pg_
</literal>, as such names
67 are reserved for system tablespaces.
73 <term><replaceable class=
"parameter">new_owner
</replaceable></term>
76 The new owner of the tablespace.
82 <term><replaceable class=
"parameter">tablespace_option
</replaceable></term>
85 A tablespace parameter to be set or reset. Currently, the only
86 available parameters are
<varname>seq_page_cost
</varname>,
87 <varname>random_page_cost
</varname>,
<varname>effective_io_concurrency
</varname>
88 and
<varname>maintenance_io_concurrency
</varname>.
89 Setting these values for a particular tablespace will override the
90 planner's usual estimate of the cost of reading pages from tables in
91 that tablespace, and the executor's prefetching behavior, as established
92 by the configuration parameters of the
93 same name (see
<xref linkend=
"guc-seq-page-cost"/>,
94 <xref linkend=
"guc-random-page-cost"/>,
95 <xref linkend=
"guc-effective-io-concurrency"/>,
96 <xref linkend=
"guc-maintenance-io-concurrency"/>). This may be useful if
97 one tablespace is located on a disk which is faster or slower than the
98 remainder of the I/O subsystem.
107 <title>Examples
</title>
110 Rename tablespace
<literal>index_space
</literal> to
<literal>fast_raid
</literal>:
112 ALTER TABLESPACE index_space RENAME TO fast_raid;
117 Change the owner of tablespace
<literal>index_space
</literal>:
119 ALTER TABLESPACE index_space OWNER TO mary;
120 </programlisting></para>
124 <title>Compatibility
</title>
127 There is no
<command>ALTER TABLESPACE
</command> statement in
133 <title>See Also
</title>
135 <simplelist type=
"inline">
136 <member><xref linkend=
"sql-createtablespace"/></member>
137 <member><xref linkend=
"sql-droptablespace"/></member>