DROP TABLESPACE
This page documents the preview version (v2.21). Preview includes features under active development and is for development and testing only. For production, use the stable version (v2024.1). To learn more, see Versioning.
Synopsis
Use the DROP TABLESPACE
statement to remove a tablespace from the cluster.
Syntax
Semantics
- Only the owner or a superuser can drop a tablespace.
- Before dropping it, ensure that the tablespace is devoid of all database objects.
- Be aware that even if the current database isn't using the tablespace, objects from other databases might still occupy it.
- Additionally, the DROP operation may encounter issues if the tablespace is specified in the
temp_tablespaces
setting of any active session, as there could be temporary files or objects present in the tablespace.
if_exists
Under normal operation, an error is raised if the tablespace does not exist. Adding IF EXISTS
will quietly ignore any non-existent tablespaces specified.
tablespace_name
Specify the name of the tablespace to be dropped.
Example
See Tablespaces and Row Level Geo Partitioning for full guides.