by mcny · 6y ago · 0 comments
What I would like is if I have an item ID of 1 and a reservation duration of today 10AM to 11AM and I try to add another record of item ID 1 and duration 10:39AM to 11:39AM the insert should fail.
Apparently it is straightforward in db2 but not in postgresql?
I never used them but the manual page shows an example on avoiding overlaps that looks a lot like your case:
https://www.postgresql.org/docs/12/rangetypes.html#RANGETYPE...