]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/alter_tablespace.sgml
Fix psql doc typo.
[postgresql] / doc / src / sgml / ref / alter_tablespace.sgml
1 <!--
2 doc/src/sgml/ref/alter_tablespace.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-ALTERTABLESPACE">
7  <refmeta>
8   <refentrytitle>ALTER TABLESPACE</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>ALTER TABLESPACE</refname>
15   <refpurpose>change the definition of a tablespace</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-altertablespace">
19   <primary>ALTER TABLESPACE</primary>
20  </indexterm>
21
22  <refsynopsisdiv>
23 <synopsis>
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> [, ... ] )
28 </synopsis>
29  </refsynopsisdiv>
30
31  <refsect1>
32   <title>Description</title>
33
34   <para>
35    <command>ALTER TABLESPACE</command> changes the definition of
36    a tablespace.
37   </para>
38
39   <para>
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
42    owning role.
43    (Note that superusers have these privileges automatically.)
44   </para>
45  </refsect1>
46
47  <refsect1>
48   <title>Parameters</title>
49
50   <variablelist>
51    <varlistentry>
52     <term><replaceable class="parameter">name</replaceable></term>
53     <listitem>
54      <para>
55       The name of an existing tablespace.
56      </para>
57     </listitem>
58    </varlistentry>
59
60    <varlistentry>
61     <term><replaceable class="parameter">new_name</replaceable></term>
62     <listitem>
63      <para>
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.
67      </para>
68     </listitem>
69    </varlistentry>
70
71    <varlistentry>
72     <term><replaceable class="parameter">new_owner</replaceable></term>
73     <listitem>
74      <para>
75       The new owner of the tablespace.
76      </para>
77     </listitem>
78    </varlistentry>
79
80    <varlistentry>
81     <term><replaceable class="parameter">tablespace_parameter</replaceable></term>
82     <listitem>
83      <para>
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.
94      </para>
95     </listitem>
96    </varlistentry>
97   </variablelist>
98  </refsect1>
99
100  <refsect1>
101   <title>Examples</title>
102
103   <para>
104    Rename tablespace <literal>index_space</literal> to <literal>fast_raid</literal>:
105 <programlisting>
106 ALTER TABLESPACE index_space RENAME TO fast_raid;
107 </programlisting>
108   </para>
109
110   <para>
111    Change the owner of tablespace <literal>index_space</literal>:
112 <programlisting>
113 ALTER TABLESPACE index_space OWNER TO mary;
114 </programlisting></para>
115  </refsect1>
116
117  <refsect1>
118   <title>Compatibility</title>
119
120   <para>
121    There is no <command>ALTER TABLESPACE</command> statement in
122    the SQL standard.
123   </para>
124  </refsect1>
125
126  <refsect1>
127   <title>See Also</title>
128
129   <simplelist type="inline">
130    <member><xref linkend="sql-createtablespace"></member>
131    <member><xref linkend="sql-droptablespace"></member>
132   </simplelist>
133  </refsect1>
134 </refentry>