My table has two columns: startsAt endsAt Both hold date and time. I want to make following constraint: IF both columns are NOT NULL then range between startsAt and endsAt must not overlap with other ranges (from other rows). Answer You can keep your separate timestamp columns and still use an exclusion constraint on an expression: Constructing a tsrange value