PostgreSQL
A feature-rich object-relational database.
PostgreSQL is taught here in 13 lessons, running from psql and the basics of SQL through to Next steps: the PostgreSQL ecosystem and migrations. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.
| Track | Databases |
| Lessons | 13 |
| Level | Beginner to intermediate |
| Reading time | about 3 hours |
| Prerequisites | Helpful, but not required: MySQL |
Lessons
- psql and the basics of SQLDrive the server from psql, learn the meta-commands worth memorising, and create tables with the types PostgreSQL actually gives you.
- JSONB and arraysWhen a document column beats another table, how the JSON operators differ, and how to index both JSONB and arrays properly.
- Transactions and MVCC basicsIsolation levels in practice, why readers never block writers, and what vacuum is really cleaning up.
- Data types, tables and constraintsChoosing numeric, text and time types, uuid versus identity, domains, CHECK constraints, foreign keys and the deferrable options that matter.
- Joins, subqueries, CTEs and LATERALEvery join type in practice, correlated subqueries, common table expressions, recursive CTEs, LATERAL joins and RETURNING.
- Window functions, full-text search and regexWindow frames, ROW_NUMBER and LAG, running totals, tsvector search with ranking, pg_trgm fuzzy matching and pattern matching options.
- Indexes: B-tree, GIN, GiST, partial and expressionChoosing the right index type, composite column order, covering indexes with INCLUDE, partial and expression indexes, and when to reindex.
- Functions, procedures and PL/pgSQL triggersWriting SQL and PL/pgSQL functions, returning sets, DO blocks for one-off work, trigger functions, and RAISE with proper exception handling.
- Roles, permissions, schemas and row-level securityGRANT and REVOKE, role memberships, default privileges, search_path safety, row-level security policies and extension management.
- Query planning and performance tuningReading EXPLAIN ANALYZE, planner statistics, autovacuum tuning, connection pooling and prepared statements under load.
- Backup, PITR and replicationpg_dump and pg_basebackup, WAL archiving for point-in-time recovery, physical streaming replicas, logical replication and verification.
- Partitioning, extensions and advanced deploymentDeclarative range and list partitioning, partition pruning, maintenance, extension management, PostGIS and pgvector, and upgrade strategies.
- Next steps: the PostgreSQL ecosystem and migrationsMigration tooling for real production schemas, managed Postgres trade-offs, monitoring that matters, and a reading path forward.
More in Databases
SQL MySQL MongoDB Redis SQLite
FAQ
How long does the PostgreSQL course take?
It has 13 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for PostgreSQL?
Not strictly. It helps to have read MySQL first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after PostgreSQL?
Continue with MongoDB (14 lessons), the next course in Databases.