Prevent overlapping TSRANGE I have the following PG (12) reservations table 

id               uuid
reservable_id    uuid
reserved_between tsrange    


How can I ensure there are no 2 reservations for the same reservable_id overlapping each other?

A "simple" UNIQUE INDEX on reservable_id,reserved_between works only (as expected) only with equal ranges.
You need the btree_gist extension so that you can create a GiST index on an uuid:

CREATE EXTENSION btree_gist;


Now you can create an exclusion constraint:

ALTER TABLE reservations ADD EXCLUDE USING gist (
   reservable_id WITH =,
   reserved_between WITH &amp;&amp;
);


&amp;&amp; is the &ldquo;overlaps&rdquo; operator for ranges.