Subject Re: [firebird-support] Rename FOREIGN KEY column
Author Nick Upson
no there isn't

you need to create new column, populate it, change pkey of table +
fk's etc, drop original

On 15/08/07, vojtech.vild <vojtech.vild@...> wrote:
> Hi all,
>
> is in the Firebird an easy way how to rename FOREIGN KEY column?
> (or the PRIMARY KEY column)
>
> Example:
> CREATE TABLE test (id integer PRIMARY KEY);
> CREATE TABLE test2 (id integer PRIMARY KEY, ref integer REFERENCES test);
>
> ALTER TABLE test2 ALTER ref TO reftest;
>
> Error:
> unsuccessful metadata update
> MODIFY RDB$RELATION_FIELDS failed
> action cancelled by trigger (1) to preserve data integrity
> Cannot update index segment used by an Integrity Constraint
>
> Regards,
> Wild
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>