PostgreSQL for Developers
summary
Argument that SQL is a real programming language, demonstrated by concrete solutions: a nine‑line query using window functions and CTEs that computes monthly billing from a monotonically increasing counter with resets, range queries and partitions that reveal cycle behavior, and a single SQL geolocation pipeline that uses PG loader, ip4r and earthdistance to map IPs to locations and do k‑NN pub lookups. Benchmarks show sub 1–1.5 ms for indexed geolocation versus ~20 ms without, and the queries work end to end.
AI-written summary · about
chapters (12)
- 0:00Introduction to PostgreSQL for developers
- 2:00SQL as data language
- 4:11Data model design example
- 8:27Window functions power
- 13:04Counter reset with SQL
- 17:59Counter reset with partitions
- 27:18SQL as iterative code
- 27:40Extending queries with types
- 32:58Geolocation with IP ranges
- 37:14Nearest neighbor search
- 40:52Conclusion
- 41:55Q&A on SQL programming








