/

How to Create a PostgreSQL Database

How to Create a PostgreSQL Database

When you already have PostgreSQL installed, you can easily create a new database by following these steps:

  1. Open the console by typing psql postgres.
  2. Run the CREATE DATABASE command, making sure to include a unique name for your database. For example:
1
CREATE DATABASE databasename;

Remember to include a semicolon (;) at the end of the command.

  1. To confirm that your database has been successfully created, execute the \l command in the console. You should be able to see the newly created database listed.

Tags: PostgreSQL, database management