PostgreSQL Create Database
In PostgreSQL, you can create a database by using CREATE DATABASE command.
Here, database_name specifies the name of the database which you want to create.
PostgreSQL Create Database using UI
- After installing PostgreSQL in your system, go to start menu and click on the pgAdmin. You will get a page like this:
- Right click on the PostgreSQL 9.0 and connect PostgreSQL to the local host server.
- Right click on the database, go to the new database, a pop up box will appear then type the database name you want to create.
- Click "OK".
The new database is created. See this:
PostgreSQL Create Database using Query tool
- Follow the 1st and 2nd steps of the above.
- Left click on the database.
- Go to the tools on the top most line.
- Left click on the tool and you will get Query tool. Click on the query tool and put your "CREATE DATABASE" query here.
- Click on the "Play" button to execute your query.
Note: You can ignore 3rd and 4th steps and Press Ctrl+E for the same result.
Execute the following query:
Database "javatpoint" is successfully created, you can see it.