DROP_TABLESPACE(7pg16)
πΈ NAME πΈ
okay bestie, this is the DROP TABLESPACE(7) page from the PostgreSQL 16 docs β the whole vibe is remove a tablespace. π
β¨ SYNOPSIS β¨
DROP TABLESPACE [ IF EXISTS ] name
π«Ά DESCRIPTION π«Ά
DROP TABLESPACE removes a tablespace from the system. no cap, that's the main character move. β¨
Only the tablespace's owner or a superuser can drop it. The tablespace must be empty of all database objects before it can be dropped β literally all of them, bestie. π«Ά
And heads up: objects in other databases might still reside in the tablespace even if no objects in the current database are using it. also, if the tablespace is listed in the temp_tablespaces setting of any active session, the DROP might fail due to temporary files residing in the tablespace. π
π PARAMETERS π
IF EXISTSβ do not throw an error if the tablespace does not exist. a notice is issued in this case. so polite, honestly. πnameβ the name of a tablespace. simple as that. π
π₯ NOTES π₯
DROP TABLESPACE cannot be executed inside a transaction block. periodt. π₯
π EXAMPLES π
to remove tablespace mystuff from the system:
DROP TABLESPACE mystuff;
iconic. clean. very demure. β¨
π COMPATIBILITY π
DROP TABLESPACE is a PostgreSQL extension. π
π¦ SEE ALSO π¦
CREATE TABLESPACE(CREATE_TABLESPACE(7))ALTER TABLESPACE(ALTER_TABLESPACE(7))
mwah π β this one comes from PostgreSQL 16.15, dated 2026. xoxo, go drop that tablespace responsibly. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms