All Products
Search
Document Center

Hologres:DROP DATABASE

Last Updated:Mar 26, 2026

Deletes a database and all objects it contains. This operation cannot be undone.

Warning

Dropping a database permanently deletes all its objects, including tables, views, and schemas. You cannot connect to the database after it is deleted.

Permissions

Only the following roles can run this statement:

  • A superuser

  • A database owner assigned by a superuser

Syntax

DROP DATABASE [ IF EXISTS ] db_name;
Note

After you run DROP DATABASE, Hologres asynchronously deletes data and releases storage space in the backend. This process may take about 2 hours.

Parameters

ParameterDescription
IF EXISTSOptional. Suppresses the error if the database does not exist. Without this clause, dropping a non-existent database returns an error.
db_nameThe name of the database to delete.

Example

Delete the database named mydb:

DROP DATABASE mydb;

To confirm the deletion, verify that mydb no longer appears in the database list.