WITH "time_slots" AS (
SELECT generate_series(
'2020-07-13 10:00:00'::timestamp,
'2020-07-13 11:00:00'::timestamp,
'15 minutes') as time_slot
)
SELECT t0."time_slot"
FROM "time_slots" AS t0
EXCEPT (
SELECT a0."time_slot"
FROM "availabilities" AS a0
)
I have the same issue with @sztosz were i wanted to use TABLESAMPLE system_rows(n) instead of RANDOM() and thank you to @mbuhot on his answer, with a little tweak, as I wanted to get the result as an Ecto query: