6 ms·
Something like this will do the job in PostgreSQL: CREATE TABLE reservations ( item_id uuid, duration tsrange, EXCLUDE USING GIST (item_id WITH =
by woutgaze 6y ago
Something like this will do the job in PostgreSQL:
CREATE TABLE reservations (
item_id uuid,
duration tsrange,
EXCLUDE USING GIST (item_id WITH =, duration WITH &&)
);
- nicoburns 6y agoCan this be made to work if the `id` and `duration` are in different tables (with a joining key)?