PostgreSQL – How to Create Database

To create a new database in PostgreSQL, you can use the CREATE DATABASE statement. Here is the basic syntax for this statement:

CREATE DATABASE database_name;

Replace database_name with the name of the database that you want to create. For example, to create a database named my_database, you would use the following statement:

CREATE DATABASE my_database;

This will create a new database with the specified name. You can then connect to the database and start creating tables, indexes, and other database objects within it.

Leave a Comment