Subject Re: [firebird-support] Removing a check constraint caused from a domain
Author Martijn Tonies
Paul,

That's an interesting case.

Perhaps the reference from table "mytable.myfield" wasn't changed, because
SMALLINT is the same physical type as is the domain.

If this is the case, then RDB$RELATION_FIELDS should hold a reference
to the domain in RDB$FIELD_SOURCE which points to RDB$FIELDS.

Let us know what's the case :-)

Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com




I have a domain defined as:

CREATE DOMAIN BOOLEAN AS
SMALLINT
DEFAULT 0
CHECK (VALUE IN(0,1))

Next I added a field to a table of type domain:
ALTER MYTABLE ADD MYFIELD BOOLEAN;

Month's of data later I want to remove the constraint on the field:
ALTER TABLE MYTABLE ALTER MYFIELD TYPE SMALLINT;

It's now a smallint field. The CHECK is still present though I cannot
see it anywhere. I checked all RDB$ related tables and cannot find the
check. Inserting a value of 2 in this field causes a constraint error
though. How can I remove this constraint that was added because of the
original domain?