The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / alter_tablespace.sgml
blob1b86a70c42aa73d4440feca34958d99acc51c7f5
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ALTERTABLESPACE">
7 <refmeta>
8 <refentrytitle id="SQL-ALTERTABLESPACE-TITLE">ALTER TABLESPACE</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>ALTER TABLESPACE</refname>
15 <refpurpose>change the definition of a tablespace</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-altertablespace">
19 <primary>ALTER TABLESPACE</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 ALTER TABLESPACE <replaceable>name</replaceable> RENAME TO <replaceable>newname</replaceable>
25 ALTER TABLESPACE <replaceable>name</replaceable> OWNER TO <replaceable>newowner</replaceable>
26 </synopsis>
27 </refsynopsisdiv>
29 <refsect1>
30 <title>Description</title>
32 <para>
33 <command>ALTER TABLESPACE</command> changes the definition of
34 a tablespace.
35 </para>
37 <para>
38 You must own the tablespace to use <command>ALTER TABLESPACE</>.
39 To alter the owner, you must also be a direct or indirect member of the new
40 owning role.
41 (Note that superusers have these privileges automatically.)
42 </para>
43 </refsect1>
45 <refsect1>
46 <title>Parameters</title>
48 <variablelist>
49 <varlistentry>
50 <term><replaceable class="parameter">name</replaceable></term>
51 <listitem>
52 <para>
53 The name of an existing tablespace.
54 </para>
55 </listitem>
56 </varlistentry>
58 <varlistentry>
59 <term><replaceable class="parameter">newname</replaceable></term>
60 <listitem>
61 <para>
62 The new name of the tablespace. The new name cannot
63 begin with <literal>pg_</literal>, as such names
64 are reserved for system tablespaces.
65 </para>
66 </listitem>
67 </varlistentry>
69 <varlistentry>
70 <term><replaceable class="parameter">newowner</replaceable></term>
71 <listitem>
72 <para>
73 The new owner of the tablespace.
74 </para>
75 </listitem>
76 </varlistentry>
77 </variablelist>
78 </refsect1>
80 <refsect1>
81 <title>Examples</title>
83 <para>
84 Rename tablespace <literal>index_space</literal> to <literal>fast_raid</literal>:
85 <programlisting>
86 ALTER TABLESPACE index_space RENAME TO fast_raid;
87 </programlisting>
88 </para>
90 <para>
91 Change the owner of tablespace <literal>index_space</literal>:
92 <programlisting>
93 ALTER TABLESPACE index_space OWNER TO mary;
94 </programlisting>
95 </para>
96 </refsect1>
98 <refsect1>
99 <title>Compatibility</title>
101 <para>
102 There is no <command>ALTER TABLESPACE</command> statement in
103 the SQL standard.
104 </para>
105 </refsect1>
107 <refsect1>
108 <title>See Also</title>
110 <simplelist type="inline">
111 <member><xref linkend="sql-createtablespace" endterm="sql-createtablespace-title"></member>
112 <member><xref linkend="sql-droptablespace" endterm="sql-droptablespace-title"></member>
113 </simplelist>
114 </refsect1>
115 </refentry>