engineering
CHECK and EXCLUDE Constraints: Database Rules Beyond Foreign Keys
Foreign keys get the attention but they are only one of several constraint types that databases enforce. CHECK constraints encode invariants directly into the schema. EXCLUDE constraints handle the cases where uniqueness is conditional or interval-based. Both are underused, and both repay