currently to stop overlapping timestamps of specific
event_type in following table:
CREATE TABLE foo ( id UUID PRIMARY KEY, event_type TEXT, from timestamp WITH time zone NOT NULL, to timestamp WITH time zone NOT NULL, deleted timestamp WITH time zone DEFAULT NULL );
ALTER TABLE foo ADD CONSTRAINT no_overlapping_times_for_event_type EXCLUDE USING gist (event_type WITH =, tstzrange(from, to, '[)') WITH &&);
Above works fine.
How do i make it so that the constraint does not kick in if the
value populated? so that i can create delete one and create a new one with same dates without the constraint stopping me.
I only want it to stop user from creating overlapping timerange entries of same
event_type only if they're not