Re: FK - automatic value change when parent changes
Date: Sat, 27 Feb 2010 11:56:22 -0500
eh <timo.talja.email_at_gmail.com> writes:
> we have a Fk pointing to a parent table/column - and now sadly enough
> that primary key value will change.
> What would be a smart way to implement this change to these child
> tables ?
> Disabling FK's and a lot of update clauses or .... ??
Alter the FK constraint to deferred. Then, update the parent key with a follow-on update to the child key and then commit. Since the constraint is deferred, it won't bark at you during the operation.
-- Galen Boyer --- news://freenews.netfront.net/ - complaints: news_at_netfront.net ---Received on Sat Feb 27 2010 - 10:56:22 CST