I have a PG (12) database with two tables:
id uuid reservable_id uuid reserved_between tsrange
reservations.reservable_id is a foreign key on
Now, given a
[2020-02-01 14:30, 2020-02-01 15:30]) I need to find a
Reservable not reserved yet for that time interval. However, I have no idea how to proceed.
A big plus would be to find the
Reservable with the most free time (fewer reservations) for that date.