]> begriffs open source - ai-pg/blob - full-docs/man7/DROP_TABLESPACE.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / DROP_TABLESPACE.7
1 '\" t
2 .\"     Title: DROP TABLESPACE
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "DROP TABLESPACE" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 DROP_TABLESPACE \- remove a tablespace
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 DROP TABLESPACE [ IF EXISTS ] \fIname\fR
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBDROP TABLESPACE\fR
40 removes a tablespace from the system\&.
41 .PP
42 A tablespace can only be dropped by its owner or a superuser\&. The tablespace must be empty of all database objects before it can be dropped\&. It is possible that objects in other databases might still reside in the tablespace even if no objects in the current database are using the tablespace\&. Also, if the tablespace is listed in the
43 temp_tablespaces
44 setting of any active session, the
45 \fBDROP\fR
46 might fail due to temporary files residing in the tablespace\&.
47 .SH "PARAMETERS"
48 .PP
49 IF EXISTS
50 .RS 4
51 Do not throw an error if the tablespace does not exist\&. A notice is issued in this case\&.
52 .RE
53 .PP
54 \fIname\fR
55 .RS 4
56 The name of a tablespace\&.
57 .RE
58 .SH "NOTES"
59 .PP
60 \fBDROP TABLESPACE\fR
61 cannot be executed inside a transaction block\&.
62 .SH "EXAMPLES"
63 .PP
64 To remove tablespace
65 mystuff
66 from the system:
67 .sp
68 .if n \{\
69 .RS 4
70 .\}
71 .nf
72 DROP TABLESPACE mystuff;
73 .fi
74 .if n \{\
75 .RE
76 .\}
77 .SH "COMPATIBILITY"
78 .PP
79 \fBDROP TABLESPACE\fR
80 is a
81 PostgreSQL
82 extension\&.
83 .SH "SEE ALSO"
84 CREATE TABLESPACE (\fBCREATE_TABLESPACE\fR(7)), ALTER TABLESPACE (\fBALTER_TABLESPACE\fR(7))