Django
PostgreSQL Exclusion Constraints: Stop Double-Booking in SQL
Application-level overlap checks fail under concurrent writes. Use PostgreSQL tstzrange, btree_gist, and EXCLUDE USING gist to prevent double-booking safely.
Topic
A collection of essays to explore, one idea at a time.
Application-level overlap checks fail under concurrent writes. Use PostgreSQL tstzrange, btree_gist, and EXCLUDE USING gist to prevent double-booking safely.
Why firing background tasks or webhooks inside Django transaction.atomic() causes race conditions, and how transaction.on_commit() fixes them safely.