Home›PostgreSQL Tutorial
Free course
PostgreSQL Tutorial
Learn PostgreSQL from zero, one small and easy step at a time. Every idea is explained in plain words, then shown as real SQL in psql and real Python code, run against a real PostgreSQL 18 database with real output.
Course contents
Every lesson has its own page with the explanation, code you can copy, the real output, screenshots from the video, and a link that jumps straight to that moment in the video.
1. What Is PostgreSQL
2. Databases, Tables and psql
3. Querying Rows
4. Numbers, Text and Booleans
5. Dates and Times
6. Creating Tables
- CREATE TABLE13:09
- Identity Columns14:08
- Constraints14:59
7. Foreign Keys and RETURNING
8. Upsert, Generated Columns, ALTER
- Upsert with ON CONFLICT18:20
- Generated Columns19:14
- ALTER TABLE20:05
9. Joins, LATERAL and FILTER
- Joins Refresher20:55
- LATERAL Joins21:54
- Aggregates and FILTER22:49
10. ROLLUP and CTEs
- GROUPING SETS and ROLLUP23:44
- CTEs24:46
- Recursive CTEs25:41
11. Window Functions
- Window Functions26:57
- Top N per Group27:55
- Running Totals and LAG28:45
12. DISTINCT ON, generate_series, Report
- DISTINCT ON29:33
- generate_series30:25
- Practice: The Monthly Report31:21
13. Arrays
- Arrays32:13
- Array Operators33:10
- unnest and array_agg34:05
14. JSONB
- JSONB Basics34:53
- Querying JSONB35:49
- JSONB Containment36:37
15. Updating and Building JSON
- Updating JSONB37:26
- Building JSON38:18
- JSONB or Columns?39:11
16. Enums, UUIDs and Ranges
- Enums and Domains39:58
- UUIDs40:56
- Range Types41:53
17. Indexes and EXPLAIN
- How Indexes Work42:52
- B-tree Indexes43:50
- EXPLAIN44:41
18. EXPLAIN ANALYZE and Smarter Indexes
19. GIN, BRIN and Index Mistakes
- GIN Indexes48:33
- BRIN Indexes49:33
- Index Mistakes50:25
20. Full-Text Search
- Full-Text Search51:20
- tsvector and tsquery52:27
- Ranking and Headlines53:29
21. Fast Search, Fuzzy Search, Practice
22. Transactions and MVCC
- Transactions57:23
- Savepoints58:23
- MVCC59:14
23. Isolation, Locks and Job Queues
- Isolation Levels1:00:14
- Locks and Deadlocks1:01:15
- FOR UPDATE SKIP LOCKED1:02:11
24. Views and Schemas
- Views1:03:09
- Materialized Views1:04:01
- Schemas and search_path1:04:52
25. Functions and Procedures
- SQL Functions1:05:45
- PL/pgSQL1:06:43
- Procedures1:07:33
26. Triggers
- Triggers1:08:16
- An Audit Log Trigger1:09:14
- Practice: Stock Trigger1:10:10
27. Roles, Privileges and Row-Level Security
- Roles and Privileges1:11:05
- Row-Level Security1:11:54
- Practice: Shop Staff Access1:12:51
28. Postgres from Python
- psycopg Basics1:13:46
- Parameters and SQL Injection1:14:43
- Transactions in Python1:15:43
29. COPY, Pools and a Python Report
- COPY and Bulk Loading1:16:39
- Connection Pools1:17:34
- Practice: A Python Report1:18:25
30. Partitioning, VACUUM and Statistics
- Partitioning1:19:11
- VACUUM and Autovacuum1:20:10
- Statistics and ANALYZE1:21:01
31. Finding and Fixing Slow Queries
- pg_stat_statements1:21:56
- A Slow Query Workflow1:22:55
- Configuration Basics1:23:52
32. Backups and Replication
- Backups with pg_dump1:24:43
- Restore and Point-in-Time Recovery1:25:41
- Replication1:26:35
33. NOTIFY, Extensions and pgvector
- LISTEN and NOTIFY1:27:31
- Extensions1:28:26
- pgvector1:29:20
34. Vector Search in Postgres
- Vector Search1:30:16
- Vector Indexes1:31:19
- Hybrid Search1:32:20
35. Job Queues, Mistakes and Alternatives
- Postgres as a Job Queue1:33:26
- Common Mistakes1:34:28
- Postgres vs Other Databases1:35:32
36. Project: Harbor Events, Part 1
- Project: Harbor Events, the Schema1:36:30
- Project: Load and Check1:37:28
- Project: Core Queries1:38:17
37. Project: Harbor Events, Part 2
- Project: Reports1:38:57
- Project: Search1:39:46
- Project: Speed It Up1:40:36
38. Project: Harbor Events, Part 3
- Project: Safe Bookings1:41:24
- Project: Access Rules1:42:22
- Project: Python Service1:43:09
39. Interview Questions and Quiz
- Interview Questions, Part 11:43:58
- Interview Questions, Part 21:45:01
- Quick Quiz1:45:52
40. Cheat Sheet, Roadmap and Wrap-up
- Cheat Sheet1:47:23
- Your Roadmap1:48:26
- Wrap-up1:49:08