1DROP TABLESPACE(7) PostgreSQL 13.4 Documentation DROP TABLESPACE(7)
2
3
4
6 DROP_TABLESPACE - remove a tablespace
7
9 DROP TABLESPACE [ IF EXISTS ] name
10
12 DROP TABLESPACE removes a tablespace from the system.
13
14 A tablespace can only be dropped by its owner or a superuser. The
15 tablespace must be empty of all database objects before it can be
16 dropped. It is possible that objects in other databases might still
17 reside in the tablespace even if no objects in the current database are
18 using the tablespace. Also, if the tablespace is listed in the
19 temp_tablespaces setting of any active session, the DROP might fail due
20 to temporary files residing in the tablespace.
21
23 IF EXISTS
24 Do not throw an error if the tablespace does not exist. A notice is
25 issued in this case.
26
27 name
28 The name of a tablespace.
29
31 DROP TABLESPACE cannot be executed inside a transaction block.
32
34 To remove tablespace mystuff from the system:
35
36 DROP TABLESPACE mystuff;
37
39 DROP TABLESPACE is a PostgreSQL extension.
40
42 CREATE TABLESPACE (CREATE_TABLESPACE(7)), ALTER TABLESPACE
43 (ALTER_TABLESPACE(7))
44
45
46
47PostgreSQL 13.4 2021 DROP TABLESPACE(7)