Issue Details (XML | Word | Printable)

Key: CORE-3428
Type: Bug Bug
Status: Open Open
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: sqldba
Votes: 6
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Alter column size not possible when column used in Constraint

Created: 04/Apr/11 03:45 PM   Updated: 19/May/14 11:44 PM
Component/s: Engine
Affects Version/s: 2.1.0, 2.0.4, 2.1.1, 2.0.5, 2.1.2, 2.1.3, 1.5.6, 3.0 Initial, 2.0.6, 2.5.0, 2.1.4
Fix Version/s: None

Environment: Windows 7


 Description  « Hide
When the column is used in a constraint, altering the column size is not possible. Manually updating the RDB$Fields table also yields the same error.

Example:
CREATE TABLE test_table
(
   test_column VARCHAR(25) NOT NULL PRIMARY KEY.
   CHECK (test_column <> 'a')
);

After the table is created, you cannot increase the column length because it is used in a constraint. You would have to drop all constraints. This is very difficult if there are several constraints referring to this column. You would also have to recreate all the constraints which is very difficult in a large database.

This issue also applies to domains (this bug defeats the whole purpose of using domains). All other DBMS allow modification of column length even if it is used in a constraint. Just because Firebird [correction from: Firefox] uses it as a index, there is no excuse for this bug.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Sean Leyne made changes - 04/Apr/11 05:23 PM
Field Original Value New Value
Description When the column is used in a constraint, altering the column size is not possible. Manually updating the RDB$Fields table also yields the same error.

Example:
CREATE TABLE test_table
(
   test_column VARCHAR(25) NOT NULL PRIMARY KEY.
   CHECK (test_column <> 'a')
);

After the table is created, you cannot increase the column length because it is used in a constraint. You would have to drop all constraints. This is very difficult if there are several constraints referring to this column. You would also have to recreate all the constraints which is very difficult in a large database.

This issue also applies to domains (this bug defeats the whole purpose of using domains). All other DBMS allow modification of column length even if it is used in a constraint. Just because Firefox uses it as a index, there is no excuse for this bug.
When the column is used in a constraint, altering the column size is not possible. Manually updating the RDB$Fields table also yields the same error.

Example:
CREATE TABLE test_table
(
   test_column VARCHAR(25) NOT NULL PRIMARY KEY.
   CHECK (test_column <> 'a')
);

After the table is created, you cannot increase the column length because it is used in a constraint. You would have to drop all constraints. This is very difficult if there are several constraints referring to this column. You would also have to recreate all the constraints which is very difficult in a large database.

This issue also applies to domains (this bug defeats the whole purpose of using domains). All other DBMS allow modification of column length even if it is used in a constraint. Just because Firebird [correction from: Firefox] uses it as a index, there is no excuse for this bug.