How to create database in PgAdmin 4
Open connected server, then right click "databases" to create new database. Select "Create" then click on the option "Database".
Create Database wizard will be opened to create database.
Give database name and other details to create database using PgAdmin 4. Here we will give the database name as "NoviceTechie", then click "Save"
Database will be created under the Databases.
Create database in PostgreSQL using PSQL
In Postgres CREATE DATABASE command creates new PostgreSQL database. The syntax to create database in PostgreSQL is
CREATE DATABASE database_name WITH [OWNER = role_name] [TEMPLATE = template] [ENCODING = encoding] [LC_COLLATE = collate] [LC_CTYPE = ctype] [TABLESPACE = tablespace_name] [ALLOW_CONNECTIONS = true | false] [CONNECTION LIMIT = max_concurrent_connection] [IS_TEMPLATE = true | false ]
PSQL command to create database in PostgreSQL server is
CREATE DATABASE database_name;
Using above postgres createdb command will create a new database in post gre sql server with default parameter. To execute the CREATE DATABASE statement you need to have a superuser role or a special CREATEDB privilege.
Psql list databases command is
A Single Postgres server process has the capability to handle multiple databases simultaneously. Each database is stored in distinct sets of files within its dedicated directory within the server's data directory. To observe all the defined databases on the server, you can utilize the \list meta-command or its shortcut \l.
\l
Please visit other related articles
PostgreSQL: Add macros in PgAdminIII
PostgreSQL: Export PostgreSQL data in to excel file
PostgreSQL: How to restrict the user access to the databases in Postgresql based on the permission
PostgreSQL: List table details using Alt+F1 in PostgreSQL
PostgreSQL: How to get ROW_COUNT of last executed query in PostgreSQL like MS SQL @@ROWCOUNT ?
0 comments