PostgreSQL Create Database


Connect to PostgreSQL (as the postgres user)

psql -U postgres

Create a Unique User

CREATE USER simple_user_2025 WITH PASSWORD 'securepass2025';

Create a Unique Database

CREATE DATABASE simple_db_2025     
      WITH OWNER simple_user_2025     
      ENCODING 'UTF8'     
      CONNECTION LIMIT 20; 

Grant Privileges

GRANT TEMP ON DATABASE simple_db_2025 TO simple_user_2025;

Explanation of Unique Words Used

Object TypeUnique NameDescription
Usersimple_user_2025A non-conflicting custom username
Databasesimple_db_2025A clear, distinct database name
Passwordsecurepass2025Easy to remember yet secure

Optional: Connect to Your New Database

psql -U simple_user_2025 -d simple_db_2025

Prefer Learning by Watching?

Watch these YouTube tutorials to understand POSTGRESQL Tutorial visually:

What You'll Learn:
  • 📌 How to Create Database in PostgreSQL | Create Database in PostgreSQL pgAdmin Tutorial
  • 📌 How to Create Database and Tables PostgreSQL
Previous Next