Subject CHECK Constraints (was: Re: [firebird-support] Re: Checking periods don't overlap)
Author johnsparrowuk
Grin, well I did start that way! (I won't mention 'dirty reads'
again, promise!)

I wanted to have period records that can't overlap, as in:

Check not exists(select idcode from T where new.startdate > enddate
or new.enddate < startdate and new.idcode <> idcode)

Loads of people (including me!) have suggested cunning work-arounds
to prevent overlapping. The simplest of which is to use
table_stability isolation.

That's fine. I'd just hope there will be a more simple (or less
blocking) solution in the future (like a check constraint).

Esoteric multi-gen solutions are great, but they're going to turn
newbies off.

John

--- In firebird-support@yahoogroups.com, "Ivan Prenosil"
<Ivan.Prenosil@s...> wrote:
> > So you don't see a problem with the behaviour of check
constraints at
> > the moment?
>
> I am not against any useful feature. If you have some suggestion
> how check constraints could be enhanced just tell us.
> Don't worry how much you know abou implementation - somebody
> who knows enough will say whether such proposal is feasible or not.
> (and sometimes even discussion about feature that can't work
> can lead to better ideas that will)
>
> In each case it will be better to start by exact defining the
problem
> and specifying required behaviour than by directly suggesting
> solution (e.g. dirty-reads).
>
> Ivan