DBMS Connectivity Notes

PostgreSQL + Python, one topic at a time. Search, copy, and practise.

Python Cheatsheet →
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
       ↓
      Rows

Why 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

TermMeaning
PostgreSQL ServerSoftware process that manages databases
ClusterPostgreSQL instance containing databases and configuration
DatabaseLogical container for database objects
SchemaNamespace inside a database
TableStores data in rows and columns
RowOne complete record
ColumnOne attribute of a record
Role/UserIdentity used to access PostgreSQL

Example

Diagram / Output
PostgreSQL Server
      ↓
   college_db
      ↓
    public
      ↓
   students
      ↓
 rows + columns

Remember

Important Note

Server → Database → Schema → Table → Rows/Columns


3. PostgreSQL vs psql vs pgAdmin

These are different things.

NamePurpose
PostgreSQLDatabase management system
PostgreSQL ServerRuns and manages databases
psqlCommand-line client
pgAdminGraphical client
psycopg2Python PostgreSQL driver

Think of it like:

Diagram / Output
PostgreSQL
   ↑
 ┌─┴─────────────┐
psql          pgAdmin
   ↑
Python + psycopg2

Important

psql is not PostgreSQL itself.

It is a client used to communicate with PostgreSQL.


Notes by Shiva Yadav · Course resources