DROP DATABASE
On this page
Drops a database.
Syntax
DROP DATABASE [IF EXISTS] <database_name> [FORCE]
DROP SCHEMA [IF EXISTS] <database_name> [FORCE]
Remarks
-
By default, the
DROP DATABASE
command waits for the running queries to finish before dropping the database.To override this behavior and kill any running queries, use the FORCE
option. -
This command causes implicit commits.
Refer to COMMIT for more information. -
This command cannot be run on system databases.
-
This command drops the Point-In-Time Recovery (PITR) history.
A database cannot be restored to the PITR milestone taken before the database was dropped. -
Refer to the Permission Matrix for the required permission.
Dropping a Database in a Workspace
Executing DROP DATABASE
in a workspace can be only done from the primary R/W database.
Examples
DROP DATABASE IF EXISTS test;
DROP DATABASE IF EXISTS db FORCE;
Last modified: January 11, 2023