Mastering Postgres
Introduction
Introduction to the course
Overview of course structure
Postgres vs. everyone
The psql CLI
Data Types
Introduction to schema
Integers
Numeric
Floating point
Storing money
NaNs and infinity
Casting types
Characters types
Check constraints
Domain types
Charsets and collations
Binary data
UUIDs
Boolean
Enums
Timestamps
Timezones
Dates and times
Advanced Data Types
Intervals
Serial type
Sequences
Identity
Network and mac addresses
JSON
Arrays
Generated columns
Text search types
Bit string
Ranges
Composite types
Nulls
Unique constraints
Exclusion constraints
Foreign key constraints
Indexing
Introduction to indexes
Heaps and CTIDs
B-Tree overview
Primary keys vs. secondary indexes
Primary key types
Where to add indexes
Index selectivity
Composite indexes
Composite range
Combining multiple indexes
Covering indexes
Partial indexes
Index ordering
Ordering nulls in indexes
Advanced Indexing
Functional indexes
Duplicate indexes
Hash indexes
Naming indexes
Understanding Query Plans
Introduction to explain
Explain structure
Scan nodes
Costs and rows
Explain analyze
Generating Results
Introduction to queries
Cross joins
Inner joins
Outer joins
Subqueries
Lateral joins
ROWS FROM
Filling gaps in sequences
Subquery elimination
Combining queries
Set generating functions
Indexing joins
Advanced SQL
Introduction to advanced SQL
Grouping
Grouping sets, rollups, cubes
Window functions
CTEs
CTEs with window functions
Recursive CTE
Hierarchical recursive CTE
Handling nulls
Row value syntax
Views
Materialized views
Removing duplicate rows
Upsert
Returning keyword
COALESCE + generated column
Full Text Search
Introduction to full text search
Searching with LIKE
Vectors, queries, and ranks
Websearch
Ranking
Indexing full text search
Highlighting
Advanced JSON
Intro to JSON
JSON vs JSONB
Validating JSON
Creating JSON objects + arrays
JSON extraction
JSON containment
JSON existence
JSON recordset
Updating JSON
Indexing JSON parts
GIN index
Vectors (pgvector)
Intro to pgvector
Vector embedding columns
Find related articles
Upsert vector embedding
Semantic search
Other operators
Vector indexes
Outro
Thank you
Bonus interviews
Heroku's glory days & Postgres vs the world (with Craig Kerstiens)
Creating a Postgres platform with Monica & Tudor from Xata.io
Bootstrapping an email service provider (with Jesse Hanley)
Next video (8)
Introduction
Postgres vs. everyone

Full Course

$
349
$399
USD, one-time fee
I bought Mastering Postgres because I use Postgres a lot and wanted to support Aaron and his content. I already learned more than I expected and have been very impressed with the quantity and work Aaron put in.
Timo Strackfeldt
Timo Strackfeldt

PostgreSQL database platform

Shorten dev cycles with branching and zero-downtime schema migrations.

Test Data

I've made my test data available for you to use and follow along.

Download
or
Use on Xata

Summary

In this course, you'll learn how to use Postgres effectively, with a focus on scenarios where it excels and where it might not be the best fit. While Postgres offers powerful features, it's important to understand that it's not always the right tool for every job, just like MySQL and SQLite. My goal is to help you navigate Postgres' strengths and limitations to use it effectively in your projects.

Video Transcript

One thing we have to talk about is Postgres versus X, right?

Postgres versus MySQL. Postgres versus SQLite, Postgres versus whatever else, right? Postgres versus the world, honestly.

Postgres is amazing. It's extremely extensible, extremely performant. They continue to make updates that make things better and not worse. Postgres is, it's just very, very feature-rich and very powerful.

It is not the right tool for every scenario. It is the right tool for a lot of scenarios. Here's what I wanna tell you. My job here is not to engage in some sort of flame war between Postgres and MySQL. I'm not gonna tell you why Postgres is amazing and why MySQL sucks, that may very well be true, but that's not my responsibility here. My responsibility here is to teach you how to use Postgres really, really well, and hopefully illuminate the scenarios where it works amazingly, and maybe somewhere it doesn't work super well.

We have a full module on full text search, but in some cases, using Elasticsearch is gonna be way, way better. It's a tool built for that purpose. Even on something like Xata.io, they stream the data out for you. They stream it out into an Elasticsearch cluster because full-text search can be really gnarly, and you might need to reach outside of Postgres for that.

I love SQLite. I have a full course on SQLite, which is very good, by the way. SQLite is not right for every use case. Postgres is not right for every use case. What I'm gonna do in this course is I'm gonna teach you how to be really, really good at Postgres. Throughout the course, I'm gonna try to tell you scenarios where Postgres works really well, but I'm not gonna be afraid of saying, "This is a little bit weird," or, "I don't like that Postgres does that."

Because my job is not to be a Postgres militant evangelist. My job is to teach you how to use the thing really well. That's the lane that I wanna in, is if you like Postgres and you want to use it, that's awesome. Let me help you use it the best way possible.