PostgreSQL create and drop database commands

1. Create a new database

Syntax:
CREATE DATABASE [IF NOT EXISTS] db_name;
Example:
CREATE DATABASE mydb;

Here mydb is the name of the database.

2. Drop a database permanently

Syntax:
DROP DATABASE [IF EXISTS] db_name;
Example:
DROP DATABASE mydb;

References


Comments