]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/drop_tablespace.sgml
Create a "sort support" interface API for faster sorting.
[postgresql] / doc / src / sgml / ref / drop_tablespace.sgml
1 <!--
2 doc/src/sgml/ref/drop_tablespace.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-DROPTABLESPACE">
7  <refmeta>
8   <refentrytitle>DROP TABLESPACE</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>DROP TABLESPACE</refname>
15   <refpurpose>remove a tablespace</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-droptablespace">
19   <primary>DROP TABLESPACE</primary>
20  </indexterm>
21
22  <refsynopsisdiv>
23 <synopsis>
24 DROP TABLESPACE [ IF EXISTS ] <replaceable class="PARAMETER">tablespace_name</replaceable>
25 </synopsis>
26  </refsynopsisdiv>
27
28  <refsect1>
29   <title>Description</title>
30
31   <para>
32    <command>DROP TABLESPACE</command> removes a tablespace from the system.
33   </para>
34
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>
46
47  <refsect1>
48   <title>Parameters</title>
49
50   <variablelist>
51
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>
61
62    <varlistentry>
63     <term><replaceable class="PARAMETER">tablespace_name</replaceable></term>
64     <listitem>
65      <para>
66       The name of a tablespace.
67      </para>
68     </listitem>
69    </varlistentry>
70   </variablelist>
71  </refsect1>
72
73  <refsect1>
74   <title>Notes</title>
75
76    <para>
77     <command>DROP TABLESPACE</> cannot be executed inside a transaction block.
78    </para>
79  </refsect1>
80
81
82  <refsect1>
83   <title>Examples</title>
84
85   <para>
86    To remove tablespace <literal>mystuff</literal> from the system:
87 <programlisting>
88 DROP TABLESPACE mystuff;
89 </programlisting></para>
90  </refsect1>
91
92  <refsect1>
93   <title>Compatibility</title>
94
95   <para>
96    <command>DROP TABLESPACE</command> is a <productname>PostgreSQL</>
97    extension.
98   </para>
99  </refsect1>
100
101  <refsect1>
102   <title>See Also</title>
103
104   <simplelist type="inline">
105    <member><xref linkend="sql-createtablespace"></member>
106    <member><xref linkend="sql-altertablespace"></member>
107   </simplelist>
108  </refsect1>
109
110 </refentry>