The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / drop_tablespace.sgml
blob6fbb6fc1e6f0a681eadc33c8370eec985864af81
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPTABLESPACE">
7 <refmeta>
8 <refentrytitle id="SQL-DROPTABLESPACE-TITLE">DROP TABLESPACE</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>DROP TABLESPACE</refname>
15 <refpurpose>remove a tablespace</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-droptablespace">
19 <primary>DROP TABLESPACE</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 DROP TABLESPACE [ IF EXISTS ] <replaceable class="PARAMETER">tablespacename</replaceable>
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>DROP TABLESPACE</command> removes a tablespace from the system.
33 </para>
35 <para>
36 A tablespace can only be dropped by its owner or a superuser.
37 The tablespace must be empty of all database objects before it can be
38 dropped. It is possible that objects in other databases might still reside
39 in the tablespace even if no objects in the current database are using
40 the tablespace. Also, if the tablespace is listed in the <xref
41 linkend="guc-temp-tablespaces"> setting of any active session, the
42 <command>DROP</> might fail due to temporary files residing in the
43 tablespace.
44 </para>
45 </refsect1>
47 <refsect1>
48 <title>Parameters</title>
50 <variablelist>
52 <varlistentry>
53 <term><literal>IF EXISTS</literal></term>
54 <listitem>
55 <para>
56 Do not throw an error if the tablespace does not exist. A notice is issued
57 in this case.
58 </para>
59 </listitem>
60 </varlistentry>
62 <varlistentry>
63 <term><replaceable class="PARAMETER">tablespacename</replaceable></term>
64 <listitem>
65 <para>
66 The name of a tablespace.
67 </para>
68 </listitem>
69 </varlistentry>
70 </variablelist>
71 </refsect1>
73 <refsect1>
74 <title>Notes</title>
76 <para>
77 <command>DROP TABLESPACE</> cannot be executed inside a transaction block.
78 </para>
79 </refsect1>
82 <refsect1>
83 <title>Examples</title>
85 <para>
86 To remove tablespace <literal>mystuff</literal> from the system:
87 <programlisting>
88 DROP TABLESPACE mystuff;
89 </programlisting>
90 </para>
91 </refsect1>
93 <refsect1>
94 <title>Compatibility</title>
96 <para>
97 <command>DROP TABLESPACE</command> is a <productname>PostgreSQL</>
98 extension.
99 </para>
100 </refsect1>
102 <refsect1>
103 <title>See Also</title>
105 <simplelist type="inline">
106 <member><xref linkend="sql-createtablespace" endterm="sql-createtablespace-title"></member>
107 <member><xref linkend="sql-altertablespace" endterm="sql-altertablespace-title"></member>
108 </simplelist>
109 </refsect1>
111 </refentry>