DROP TABLESPACE
Description
Drops a tablespace.
Precautions
- Only the tablespace owner or a user granted the DROP permission can run the DROP TABLESPACE command. A system administrator has this permission by default.
- The tablespace to be deleted should not contain any database objects. Otherwise, an error will be reported.
- DROP TABLESPACE cannot be rolled back and therefore cannot be run in transaction blocks.
- During execution of DROP TABLESPACE, database queries by other sessions using \db may fail and need to be reattempted.
- If DROP TABLESPACE fails to be executed, run DROP TABLESPACE IF EXISTS.
Syntax
DROP TABLESPACE [ IF EXISTS ] tablespace_name;
Parameters
- IF EXISTS
Reports a notice instead of an error if the specified tablespace does not exist.
- tablespace_name
Specifies the name of the tablespace to be deleted.
Value range: an existing tablespace name
Examples
See Examples in CREATE TABLESPACE.
Helpful Links
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.