Subject | Alter Column Length that is part of a constraint (also domain) |
---|---|
Author | sqldba86 |
Post date | 2011-04-03T18:06:41Z |
CREATE TABLE test_table
(
test_column VARCHAR(25) NOT NULL PRIMARY KEY,
CHECK (test_column <> 'a')
);
If I try to alter the test_column column size after the table is created, Firebird complains that this is not possible because the column is being used in a constraint. I tried to manually update the RDB$Fields system table but it complains of the same error.
To alter the column size, I'd have to drop EVERY constraint that is using this test_column which gets to be A LOT and then I have to re-create all of them. This is very ridiculous since every other DBMS like Oracle, MS SQL, Mysql, and postgre allow you to change column lengths even if part of a constraint.
How can I change it without dropping the constraints or is there a tool out there that will automate this process? (this also applies to domain. It actually defeats the whole purpose of using a domain.)
(
test_column VARCHAR(25) NOT NULL PRIMARY KEY,
CHECK (test_column <> 'a')
);
If I try to alter the test_column column size after the table is created, Firebird complains that this is not possible because the column is being used in a constraint. I tried to manually update the RDB$Fields system table but it complains of the same error.
To alter the column size, I'd have to drop EVERY constraint that is using this test_column which gets to be A LOT and then I have to re-create all of them. This is very ridiculous since every other DBMS like Oracle, MS SQL, Mysql, and postgre allow you to change column lengths even if part of a constraint.
How can I change it without dropping the constraints or is there a tool out there that will automate this process? (this also applies to domain. It actually defeats the whole purpose of using a domain.)