Difference between revisions of "Delete database"
Jump to navigation
Jump to search
Line 8: | Line 8: | ||
[[DROP DATABASE]] [IF EXISTS] [[my_database_name]] (FORCE) [[;]] | [[DROP DATABASE]] [IF EXISTS] [[my_database_name]] (FORCE) [[;]] | ||
− | Note: Force introduced in [[PostgreSQL 13]] | + | Note: Force introduced in 2022 ([[PostgreSQL 13]]) |
DROP DATABASE database_name; | DROP DATABASE database_name; |
Revision as of 12:19, 16 December 2022
PostgreSQL
DROP DATABASE [IF EXISTS] my_database_name;
Do not forget the ;
at the end of the line
DROP DATABASE [IF EXISTS] my_database_name (FORCE) ; Note: Force introduced in 2022 (PostgreSQL 13)
DROP DATABASE database_name; Output: DROP DATABASE
DROP DATABASE database_name (FORCE);
ERROR: database "XXXXX" is being accessed by other users DETAIL: There are 4 other sessions using the database
Related terms:
Related
DELETE
DROP TABLE
CREATE DATABASE
\list
- PostgreSQL superuser
ALTER DATABASE
ERROR: must be owner of database
See also
Advertising: