How to create database in Azure PostgreSQL Server

In this article, we will see how to create database in Azure PostgreSQL Server.

Database is collection objects like tables, views, indexes, schemas, ….etc.

We are going to create a database in Azure PostgreSQL server by using following two methods.

1. Using CREATE DATABASE command.
2. Using GUI method using pgadmin tool.

1. Create database in Azure PostgreSQL Server using CREATE DATABASE statement:

Connect to Azure PostgreSQL server from pgadmin or psql tool

How to create database in Azure PostgreSQL Server

and run the following query to create database with the name ‘r2schools’.

CREATE DATABASE r2schools;

2. Create database in Azure PostgreSQL Server using pgadmin tool:

1. Connect to the Azure PostgreSQL Server.
2. Right click on databases select create then select Database as show below.

3. Provide the name in Definition tab and select Owner from drop down. And in definition tab select Encoding, Template, Tablespace, Collation, Character Type and connection limit. Once done click on Save.