---
title: "DROP TABLESPACE"
url: "https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/ddl_drop_tablespace/"
---

# DROP TABLESPACE

Use the DROP TABLESPACE statement to remove a tablespace from the cluster.

## Synopsis

Use the `DROP TABLESPACE` statement to remove a tablespace from the cluster.

## Syntax

- [![Grammar Icon](/icons/file-lines.svg)Grammar](#grammar-1)
- [![Diagram Icon](/icons/diagram.svg)Diagram](#diagram-1)

```output.ebnf
drop_tablespace ::= DROP TABLESPACE [ IF EXISTS ] tablespace_name
```

#### drop\_tablespace

DROPTABLESPACEIFEXISTS[tablespace\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#tablespace-name)

## 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](/stable/explore/going-beyond-sql/tablespaces/ "Tablespaces") and [Row Level Geo Partitioning](/stable/explore/multi-region-deployments/row-level-geo-partitioning/ "Row Level Geo Partitioning") for full guides.

## See also

- [CREATE TABLESPACE](/stable/api/ysql/the-sql-language/statements/ddl_create_tablespace "CREATE TABLESPACE")
