The CREATE DATABASE command is used to create a new database in PostgreSQL. By default the new database will be created with the same encoding and collation as the template database. The owner of the new database will be the user who executed the command.To create a database in PostgreSQL you must have administrative privileges or be the owner of the database. The owner is the user who executes the CREATE DATABASE statement. The owner can be any valid user. To create a database you must be a superuser or have the special CREATEDB privilege. When you create a database PostgreSQL stores the database in your data directory. The default location for this directory is /var/lib/postgresql/data on Linux systems and C:\Program Files\PostgreSQL\data on Windows systems.When you create a database Postgres will automatically create a new role with the same name as the database. This role will be the owner of the database and will have all privileges on it. You can use this role to connect to the database and perform any actions you need.