Subject Re: [ib-support] check constraint stops working after backup and restore
Author Martijn Tonies

> >my problem is:
> >I create a domain with check constraint.
> >
> >e.g.
> >ADD CHECK (exists
> > (
> > select *
> > from transport_types
> > where tt_id = value
> > ))
> >
> >This constraint works OK. After backup and restore it stops working. It
> >objects even if the data is OK. Problem goes away after recompilation of
> >the constraint.
> Not a bug, guess is that, at the time the CHECK constraint is
> being added, the table transport_types doesn't exist. It's a cert that
> gbak rebuilds domains before it begins on tables. I'd recommend doing
> with insert and update triggers rather than a CHECK constraint. Stick
> constants in CHECK expressions.

Check constraints on Tables are alright. But with a domain, you should use
a value-check constraint, no constraint related to tables/views etc...

My 0.02...

With regards,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase

Firebird Workbench - the developer tool for Firebird

Upscene Productions

"This is an object-oriented system.
If we change anything, the users object."