Exclusion
An EXCLUDE constraint rejects a row that conflicts with an existing one under the operators you choose. Equality on an int column in a GiST index needs btree_gist.
task
Remove the later one of each overlapping pair, then add an EXCLUDE constraint so a team never has two overlapping shifts.