All Products
Search
Document Center

Hologres:DROP DATABASE

Last Updated:Sep 14, 2023

You can execute the DROP DATABASE statement to drop a database. This topic describes how to use the DROP DATABASE statement.

Limits

  • Only a superuser of a database or the database owner configured by a superuser can execute this statement to drop the database.

  • When you drop a database, all objects in the database are dropped.

  • After a database is dropped, you can no longer connect to it.

  • The DROP DATABASE statement is executed in an asynchronous manner. The data deletion time varies based on the storage class.

    • Data of the Standard storage class is deleted and the storage space is released about two hours after the statement is executed. After data is deleted, no storage fees are incurred.

    • Data of the Cold Archive storage class is deleted immediately after the statement is executed. After data is deleted, no fees are incurred.

Syntax

DROP DATABASE [ IF EXISTS ] db_name;

Example

Execute the following statement to drop a database named mydb:

DROP DATABASE mydb;