The Art of PostgreSQL
The 2026 update is the most significant revision since the book's first publication. It modernises the text from PostgreSQL 11 to the 17/18 landscape, adds an entirely new chapter on vector search, introduces 56 new figures, and ships with a fully integrated companion lab.
Wondering whether SQL still matters now that AI can generate queries? Here's why it matters more than ever. →
A selection of the 56 new figures in this edition
@> point-in-time queryNew features introduced across PostgreSQL versions 12 through 18 are covered where they apply to the book's topics:
GENERATED ALWAYS AS (expr) STORED — stored generated columnsPG 12MATERIALIZED / NOT MATERIALIZED CTE hintsPG 12SEARCH and CYCLE clauses in recursive CTEsPG 14EXCLUDE clause in window frame specificationsPG 14['key']PG 14range_agg()PG 14NULLS NOT DISTINCT in unique constraints and indexesPG 15MERGE statement; WHEN NOT MATCHED BY SOURCEPG 15/17JSON_TABLEPG 16/17C.UTF-8 collationPG 17MERGE RETURNING merge_action()PG 17SPLIT PARTITION / MERGE PARTITIONSPG 17COPY … ON ERROR IGNORE, LOG_VERBOSITY, REJECT_LIMITPG 17/18GENERATED ALWAYS AS (expr) VIRTUAL — virtual generated columnsPG 18uuidv7() — time-ordered UUID generationPG 18RETURNING OLD / RETURNING NEW — before/after values in DMLPG 18The book also expands coverage of existing features across all PostgreSQL versions: B-tree, GiST, SP-GiST, GIN, BRIN, and Bloom index internals; fillfactor and HOT updates; GROUPING() function; Row Level Security; and RANGE / GROUPS window frame modes.
Part VIII (Extensions) gains two major additions:
vector type, HNSW and IVFFlat index types, distance operators (<-> / <#> / <=>), and hybrid search combining vector similarity with relational filtersAll 56 figures are new TikZ diagrams, generated from SQL or authored for this edition — not drawn by hand. They span every part of the book:
The lab is now a first-class part of the book. One command starts a complete PostgreSQL environment with all datasets pre-seeded:
docker compose up -d
Datasets include F1db, MoMA, Geonames, Last.fm, Wikidata castle ruins, London OSM,
and more — every dataset used in the book. Open localhost:8042 to reach
an interactive query pane organised by book chapter — every SQL query from the book
is there, ready to run, edit, and experiment with. No account required beyond Docker.
Learn more about the lab →

pgvector chapter, 56 new figures, PG 12–18 coverage, integrated lab. 570 pages.
Renamed to The Art of PostgreSQL. Restructured and expanded. Covers PostgreSQL 10–14.
Published as Mastering PostgreSQL in Application Development. Covers PostgreSQL 10–11.
Digital edition — PDF and ePub — immediate download. 30-day money-back guarantee.