Subject Re: [firebird-support] Modify Primary key
Author Martijn Tonies
Scott,


> I need to add another field to a primary key on a live database. I
> added the record to the RDB$INDEX_SEGMENTS and all looks good except I
> can't change RDB$INDICES.RDB$SEGMENT_COUNT with out getting an error:

Pardon me?!

> ISC ERROR MESSAGE:
> action cancelled by trigger (1) to preserve data integrity
> Cannot modify index used by an Integrity Constraint
>
> Makes sense, but is there any way to get around this?
>
> I don't want to loose the data by removing the table and rewriting it.
>
> The table is only used in one application, by one user, so it's easy
> enough to make sure it's not accessed while it's modified.
>
> Adding the field to the primary key will relax uniqueness not cause
> duplicates, so it should be allowed, or at least doable.
>
> Is there a better way?

Yes! DROP the primary key constraint and ADD another
one with the right columns! Don't start fiddling around with
the system tables!


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com