Range Types in PostgreSQL 9.2 - Your Life Will Never Be the Same
summary
PostgreSQL 9.2 adds concrete range types (ints, numerics, timestamps, dates) with operators like && (overlaps), functions lower/upper, and GiST indexing so overlap queries hit an index on 100k-row tests and run orders of magnitude faster than handrolled two-column logic. Exclusion constraints prevent double bookings, inet ranges get added via CREATE TYPE, and VenueBook prototypes its search and scheduling with PostgreSQL 9.2 and GiST index support, reducing long ad‑hoc SQL to single-operator checks; the feature is live soon and demonstrably works in real deployments such as VenueBook.
AI-written summary · about
chapters (11)
- 0:00Start
- 0:05Range Types
- 5:16Read Range Notation
- 5:54Infinite Ranges
- 6:44Build a Range
- 22:57Range Types in the Wild
- 24:49Documentation
- 25:32Conclusion
- 32:12Reasons Why Not To Use Range Types
- 33:55Have You Had To Deal with Tables with Time Ranges That Are Being Time Partitioned
- 48:26Discreet Ranges and Continuous Ranges
related talks
24mPostgreSQL Design Patterns
45mAdvanced Data Types in PostgreSQL
43mAdvanced Data Types in PostgreSQL
27mWhat's new with constraints in Postgres 18
44mPostgreSQL in Django 1.8
53mOn Beyond Data Types
41mWhat you should know about constraints in PostgreSQL 18
57mUnderstanding Advanced Datatypes in PostgreSQL
