Level 1 · 1 / 28
Part 1
PART 1 — PostgreSQL Fundamentals
1. What is PostgreSQL?
PostgreSQL is an open-source Relational Database Management System (RDBMS).
It stores data in tables and allows applications to work with that data using SQL.
Example:
Diagram / Output
Python Application
↓
PostgreSQL
↓
Database
↓
Tables
↓
RowsWhy PostgreSQL?
- Relational database
- Uses SQL
- Supports transactions
- Strong data integrity
- Powerful querying
- Good performance
- Widely used in real applications
2. PostgreSQL Architecture
A simplified PostgreSQL structure:
Diagram / Output
PostgreSQL Server
│
├── Database 1
│ ├── Schema
│ │ ├── Table
│ │ └── Table
│ │
│ └── ...
│
├── Database 2
│ └── ...
│
└── Database 3
└── ...Important Terms
| Term | Meaning |
|---|---|
| PostgreSQL Server | Software process that manages databases |
| Cluster | PostgreSQL instance containing databases and configuration |
| Database | Logical container for database objects |
| Schema | Namespace inside a database |
| Table | Stores data in rows and columns |
| Row | One complete record |
| Column | One attribute of a record |
| Role/User | Identity used to access PostgreSQL |
Example
Diagram / Output
PostgreSQL Server
↓
college_db
↓
public
↓
students
↓
rows + columnsRemember
Important Note
Server → Database → Schema → Table → Rows/Columns
3. PostgreSQL vs psql vs pgAdmin
These are different things.
| Name | Purpose |
|---|---|
| PostgreSQL | Database management system |
| PostgreSQL Server | Runs and manages databases |
psql | Command-line client |
| pgAdmin | Graphical client |
| psycopg2 | Python PostgreSQL driver |
Think of it like:
Diagram / Output
PostgreSQL
↑
┌─┴─────────────┐
psql pgAdmin
↑
Python + psycopg2Important
psql is not PostgreSQL itself.
It is a client used to communicate with PostgreSQL.