2 doc/src/sgml/ref/alter_tablespace.sgml
3 PostgreSQL documentation
6 <refentry id="SQL-ALTERTABLESPACE">
8 <refentrytitle>ALTER TABLESPACE</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
14 <refname>ALTER TABLESPACE</refname>
15 <refpurpose>change the definition of a tablespace</refpurpose>
18 <indexterm zone="sql-altertablespace">
19 <primary>ALTER TABLESPACE</primary>
24 ALTER TABLESPACE <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
25 ALTER TABLESPACE <replaceable>name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
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> changes the definition of
40 You must own the tablespace to use <command>ALTER TABLESPACE</>.
41 To alter the owner, you must also be a direct or indirect member of the new
43 (Note that superusers have these privileges automatically.)
48 <title>Parameters</title>
52 <term><replaceable class="parameter">name</replaceable></term>
55 The name of an existing tablespace.
61 <term><replaceable class="parameter">new_name</replaceable></term>
64 The new name of the tablespace. The new name cannot
65 begin with <literal>pg_</literal>, as such names
66 are reserved for system tablespaces.
72 <term><replaceable class="parameter">new_owner</replaceable></term>
75 The new owner of the tablespace.
81 <term><replaceable class="parameter">tablespace_parameter</replaceable></term>
84 A tablespace parameter to be set or reset. Currently, the only
85 available parameters are <varname>seq_page_cost</> and
86 <varname>random_page_cost</>. Setting either value for a particular
87 tablespace will override the planner's usual estimate of the cost of
88 reading pages from tables in that tablespace, as established by
89 the configuration parameters of the same name (see
90 <xref linkend="guc-seq-page-cost">,
91 <xref linkend="guc-random-page-cost">). This may be useful if one
92 tablespace is located on a disk which is faster or slower than the
93 remainder of the I/O subsystem.
101 <title>Examples</title>
104 Rename tablespace <literal>index_space</literal> to <literal>fast_raid</literal>:
106 ALTER TABLESPACE index_space RENAME TO fast_raid;
111 Change the owner of tablespace <literal>index_space</literal>:
113 ALTER TABLESPACE index_space OWNER TO mary;
114 </programlisting></para>
118 <title>Compatibility</title>
121 There is no <command>ALTER TABLESPACE</command> statement in
127 <title>See Also</title>
129 <simplelist type="inline">
130 <member><xref linkend="sql-createtablespace"></member>
131 <member><xref linkend="sql-droptablespace"></member>