YouTip LogoYouTip

Postgresql Drop Database

# PostgreSQL Drop Database\\n\\nPostgreSQL Advanced\\n\\n(#)(#)")(#)(#)(#)(#)(#)(#)(#)(#)(#)(#)(#)(#)(#)[PostgreSQL Time/Date](#)(#)\\n\\n(#)\\n\\n(#)\\n\\n# PostgreSQL Drop Database\\n\\nPostgreSQL drop database can be done in the following three ways:\\n\\n* 1, Use the DROP DATABASE SQL statement to delete.\\n* 2, Use the dropdb command to delete.\\n* 3, Use the pgAdmin tool.\\n\\n**Note:** Be careful when deleting a database. Once deleted, all information will be lost.\\n\\n### DROP DATABASE to Drop Database\\n\\nDROP DATABASE will delete the system catalog entry of the database and delete the file directory containing the data.\\n\\nDROP DATABASE can only be executed by a superuser or the database owner.\\n\\nThe DROP DATABASE command needs to be executed in the PostgreSQL command window. The syntax is as follows:\\n\\nDROP DATABASE name\\n\\n**Parameter Description:**\\n\\n* **IF EXISTS**: Issues a notice instead of an error if the database does not exist.\\n* **name**: The name of the database to delete.\\n\\nFor example, we delete a database named tutorialdb:\\n\\npostgres=# DROP DATABASE tutorialdb;\\n\\n### dropdb Command to Drop Database\\n\\ndropdb is a wrapper for DROP DATABASE.\\n\\ndropdb is used to delete a PostgreSQL database.\\n\\ndropdb command can only be executed by a superuser or the database owner.\\n\\nThe dropdb command syntax is as follows:\\n\\ndropdb [connection-option...] [option...] dbname\\n\\n**Parameter Description:**\\n\\n**dbname**: The name of the database to delete.\\n\\n**options**: Optional parameters, which can be the following values:\\n\\n| No. | Option & Description |\\n| --- | --- |\\n| 1 | **-e** Shows the commands generated by dropdb and sends |
← Postgresql Drop TablePostgresql Create Database β†’