Help Center/
GaussDB/
Developer Guide(Centralized_V2.0-8.x)/
SQL Reference/
SQL Syntax/
D/
DROP PLUGGABLE DATABASE INCLUDING DATAFILES
Updated on 2025-05-29 GMT+08:00
DROP PLUGGABLE DATABASE INCLUDING DATAFILES
Description
Drops PDB objects and all database objects and data in the PDB.
Precautions
- This command can be used only when the GUC parameter enable_mtd is set to on.
- This command can be performed only in the non-PDB. This command cannot be executed in M-compatible databases.
- The operation user must be the PDB owner (see the pg_database.datdba system catalog) or have the SYSADMIN permission.
- Before deleting, run the ALTER PLUGGABLE DATABASE statement to stop the PDB.
- The template PDB (template_pdb) cannot be deleted using this statement.
- When a PDB is deleted, the resource plan directive object joined with the PDB is not deleted.
Syntax
DROP PLUGGABLE DATABASE pdb_name INCLUDING DATAFILES;
Parameters
- pdb_name
Specifies the name of the PDB to be dropped.
Examples
- Prerequisites
For details about how to create a PDB, see Examples in CREATE PLUGGABLE DATABASE.
- Dropping a PDB
-- If the PDB is in the open state, it cannot be dropped; the PDB must be closed first. gaussdb=# alter pluggable database my_pdb close immediate; ALTER PLUGGABLE DATABASE -- Connect to the postgres database as a system administrator and drop the closed PDB. gaussdb=# drop pluggable database my_pdb including datafiles; DROP PLUGGABLE DATABASE
Helpful Links
Parent topic: D
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot