Subject CHECK Constraints (was: Re: [firebird-support] Re: Checking periods don't overla
Author peter_jacobi.rm
Hi Martijn,

"Martijn Tonies" <m.tonies@u...> wrote:

Your example:

> Then again, Uniques might be useful deferred as well. For example,
> one cannot do this:
>
> CREATE TABLE mytable
> (
> INTCOL INTEGER NOT NULL PRIMARY KEY
> )
> COMMIT;
> INSERT INTO mytable VALUES (1);
> INSERT INTO mytable VALUES (2);
> INSERT INTO mytable VALUES (3);
> COMMIT;
>
> UPDATE mytable SET intcol = intcol + 1;
>
> While the constraint itself - after all rows have been updated - is
> perfectly valid.

From a theoretical point of view, this is a very sad and
unfortunate failure to conform to the SQL standard. It's
so a blatant violation of atomicity. It can't be that
important in practice, or it would have been fixed
already -- I hope.

"Believe it or not, there DBMSs alive today which will fail
when they encounter this example's UPDATE statement."
Peter Gulutzan, 1999

Of course, now working for MySQL, poor Peter Gulutzan
will have been confronted with even more unbelievable
deviations from the standard.

Best Regards,
Peter Jacobi