The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...

A query returning ten thousand duplicated rows. A migration that won't apply to a partitioned table. Most ORM problems are database problems in disguise. Get both ends of the stack — PostgreSQL from first SELECT to production, then EF Core 10 built on top of it: JSONB, full-text search, PostGIS, pgvector. 1,289 pages, 44 chapters, every listing verified against a live database.
Bought separately
$81.98
Minimum price
$52.99
$69.99
About the Bundle
Two books, one database.
The PostgreSQL Handbook teaches PostgreSQL itself, SQL-first: schema design, joins, JSONB, full-text search, indexes, EXPLAIN, row-level security, backups, partitioning, and streaming replication — built one system at a time against a single running example, Lumina Helpdesk, across 23 chapters and 501 pages.
The Entity Framework Core & PostgreSQL Handbook teaches you to run that same PostgreSQL from .NET: pooled DbContexts, PostgreSQL-specific type mapping, migrations EF Core can't scaffold, query plans and indexing, JSONB, full-text search, PostGIS, and pgvector — built against LuminaWork, a multi-tenant modular monolith, across 21 chapters and 788 pages.
They are two halves of the same problem. An EF Core developer who doesn't know PostgreSQL treats the database as a detail the provider will handle — until a query returns ten thousand duplicated rows, or a migration refuses a partitioned table. A PostgreSQL developer who never uses EF Core stops at the SQL — tunes the index, reads the plan, but never wires it into the application that has to run it. Together you get both ends: the database reasoned about correctly, and the ORM on top of it used the same way.
In the bundle:
No prior PostgreSQL background is assumed in either book — the PostgreSQL Handbook starts from basic SQL, and the EF Core Handbook starts from EF Core you already use and adds PostgreSQL on top of it. Neither assumes you've read the other. Start with whichever gap is in front of you: the database explained from first principles, or the ORM that finally stops fighting it.
Most EF Core material treats PostgreSQL as an implementation detail. This bundle treats it as the thing worth understanding.
About the Books
The PostgreSQL Handbook is the complete guide to PostgreSQL for developers who write SQL for a living — from your first SELECT to running a database in production with confidence.
Most SQL material stops at the query. This book keeps going: through the capabilities that are the actual reason to choose PostgreSQL, and out the far side into indexes, query plans, security, backups, partitioning, and replication. Across five parts, twenty-three chapters and 501 pages, you build one system — Lumina Helpdesk, a support-ticketing database that grows chapter by chapter from an empty schema into something with real data, real constraints, real indexes, and real operational concerns.
No prior PostgreSQL expertise is assumed. Comfort with basic SQL is enough to start; everything past SELECT, WHERE, and JOIN is built on the page, in order, against that one running example.
You'll learn to:
• Design a schema that holds up: tables, keys, data types chosen on purpose, and constraints that make bad data impossible
• Think relationally — joins, aggregation, subqueries and CTEs, and window functions that keep complex logic inside SQL instead of spilling into application code
• Use what makes PostgreSQL PostgreSQL: JSONB living beside relational columns, full-text search, server-side functions, triggers and procedures, and MVCC concurrency explained without hand-waving
• Operate it: pick the right index for the shape of the question, read an EXPLAIN plan and act on it, set up roles and row-level security, take backups that restore, partition a table that outgrew itself, and stand up streaming replication with connection pooling
• Connect it to your application — Npgsql from raw ADO.NET, EF Core over PostgreSQL, and pgvector for semantic and hybrid search in the database you already run
The last three chapters speak C# directly, but this is not a C# book: the first twenty contain none at all, and a reader who never opens Visual Studio loses nothing before Chapter 21.
Every SQL listing is real, executable SQL, verified against a live PostgreSQL 18.4 database by an automated harness before it was allowed into print. The output printed under a listing was captured from an actual run, never hand-typed. The database is deterministic by design — a fixed random seed and a fixed timestamp anchor — so when you run a listing you get the book's printed output exactly, on your machine, not "output may vary."
One script rebuilds the database to the exact state any chapter expects, so you can start reading anywhere, experiment freely, and reset when an experiment goes sideways.
Five appendices round it out: a native installation guide, a psql survival guide, the SQL style guide every listing in the book obeys, worked solutions to all 69 exercises, and a reference for what changed between PostgreSQL 16 and 18. A page-numbered index closes the book.
If you can write a SELECT, you can run PostgreSQL in production. This book is the path between the two.
Most Entity Framework Core material treats the database as a detail the provider will handle. Configure a DbContext, write LINQ, call SaveChanges. For a surprising amount of work that is exactly right, and it is why EF Core is worth using. It stops being right at the moment your application gets big enough to matter: when a query that looked innocent returns ten thousand duplicated rows, when a migration will not apply to a partitioned table, when two writers race and one silently wins, or when the feature the product needs is a capability your database has had for years and your ORM has never mentioned to you.
The Entity Framework Core & PostgreSQL Handbook closes that gap. Twenty-one chapters take you from a pooled DbContext and a deliberate primary-key decision to row-level security, PostGIS geography, and semantic search with pgvector — all on the stable surface of EF Core 10.0.11, the Npgsql provider 10.0.3, PostgreSQL 18.6, .NET 10 LTS, and C# 14.
You will learn how to:
• Configure six pooled contexts, compiled models, and configuration that scales past a single file
• Map C# onto PostgreSQL types deliberately — UUIDv7 keys, citext, arrays, ranges, enums, jsonb
• Write migrations EF Core cannot scaffold for you, including partitioned tables
• Read a query plan with EXPLAIN and choose the index the access pattern actually needs
• Stop the cartesian explosion that makes one loading strategy a trap
• Paginate by keyset instead of OFFSET, and benchmark the difference at a million rows
• Store user-defined fields as JSONB and index them so the queries stay fast
• Build full-text search with generated tsvector columns, ranking, trigrams and fuzzy matching
• Make double-booking impossible with a tstzrange exclusion constraint
• Query geography with PostGIS, and rank by meaning with pgvector and HNSW
• Fuse full-text ranking and vector similarity into one hybrid query
• Turn interceptors into an audit trail, and enforce tenant isolation in two layers that are tested against each other
• Test against a real PostgreSQL with Testcontainers, deploy through a migration mid-flight, and publish events with the outbox and change-data capture
Along the way you build LuminaWork, a multi-tenant project and field-service platform: a modular monolith with six bounded contexts, six schemas, sixteen tables and thirteen chapter-labelled migrations, carrying a million work items under real indexing pressure by Chapter 7.
What makes this book different is that almost none of it was typed. Every SQL listing was executed against a live PostgreSQL 18.6 database by an automated harness — including the ones meant to fail, which are asserted to fail with exactly the error code the prose predicts. Every C# listing is an excerpt of compiling code, diffed against the companion repository before the book will build. Every output panel was captured from a real run rather than retyped, and every benchmark table renders from committed BenchmarkDotNet artifacts. The seeder uses no random number generator at all, so when you run a listing you get the printed output: the same rows in the same order, and the same plan shape, on your machine.
That adds up to 526 listings — 202 in C#, 116 in SQL, 109 panels of captured output, and 99 of configuration — plus 67 figures and 63 exercises, three per chapter in Basic, Intermediate and Challenge tiers, each with a starter project and a working solution.
Written for .NET developers who already use EF Core. If you can model an entity, write a LINQ query and add a migration, you are ready; no PostgreSQL background is assumed. Coming from SQL Server? Appendix D is the full translation guide, written after the other twenty chapters so it could be honest about what the book had actually run.
The companion code lives at https://github.com/RachidD68/the-entity-framework-core-and-postgresql-handbook — MIT licensed, one solution of 18 projects plus 42 exercise projects, and twenty-one git tags so any listing can be read at the state its chapter printed it.
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.