You can create database on PostgreSQL easily. You can specify some parameters when creating database. If you want more about Postgresql you may want to read our other articles from the below link.
https://dbtut.com/index.php/category/postgres/
There are many ways to create database on postgresql. You can find the details in the below examples.
How do I create a new database in PostgreSQL?
1 |
CREATE DATABASE test; |
Postgres create database with owner
In this example, we also specify the owner when creating the database.
1 |
CREATE DATABASE test OWNER testUser; |
Postgres create database with tablespace
In this example, we also specify which tablespace to use when creating the database.
1 |
CREATE DATABASE test TABLESPACE x; |
Postgres create database with encoding
In this example, we specify the ENCODING option when creating the database.
1 |
CREATE DATABASE test ENCODING 'UTF8'; |
Postgres create database with template
In this example, when creating a database, we specify which template the database will be based on.
1 |
CREATE DATABASE test TEMPLATE template3; |
Lastly, you can use all the parameters together you see in the examples above.